明日みんなで桜を見に行くんですが、先生もいっしょにいらっしゃらないかなと思いまして。
Why is it there? And does it make any difference in meaning compared to dictionary form for example?
Japanese Language Stack Exchange is a question and answer site for students, teachers, and linguists wanting to discuss the finer points of the Japanese language. It only takes a minute to sign up.
Sign up to join this communityAccording to 明鏡国語辞典:
て ㊁〘終助〙
❷ 《「…でして」「…まして」「…してしまって」の形で》原因や理由、状況を示して釈明を表す。「お子様限定のサービスでして。」「電車が遅れまして。」「遅くなりまして。」「つい忘れちゃって。」
The て in your example is used to express a cause, reason or explanation/vindication.
明日みんなで桜を見に行くんですが、先生もいっしょにいらっしゃらないかなと思いまして。
"Tomorrow we're going to see cherry blossoms and I'm (we're) wondering if you'd like to join us (and that's why I came to you / that's why I'm calling you / that's why I just asked if you'd be free tomorrow, etc.)"
→ indirectly/politely inviting "Would you like to join us?" (as pointed out in the comment)
「~~先生もいっしょにいらっしゃらないかなと思いました。」 would just be a statement to say that you wondered/thought of that.