I seem to have seen/heard both.
帰り道で見た東京タワーが上空を照らしていた (source)
帰り道で見た景色 (source)
帰り道に見たかもしれない夕日の絵を描きました (source)
帰り道に見た夕日 (source)
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 communityThey mean basically the same thing and are practically interchangeable.
Having said that, I feel 帰り道に is closer to “on my way back/home”. The focus here is not so much on “where” as “when”. You were on your way home (or back to some other place) when you saw whatever you did. Where is not important.
帰り道で, on the other hand, sounds like there is a concrete route you take to go home (or go back to some other place) and you saw whatever you did there.
The difference seems to become even smaller in the following pair.
帰る途中に見た
帰る途中で見た
This could be because 途中 doesn’t make one think of a concrete route as much as 道 does.
In the following pair, 道 has a more concrete feeling than in 帰り道, and this makes に not quite idiomatic.
? 帰る途中の道に見た
帰る途中の道で見た
On the other hand, only に is acceptable in the following.
帰りに見た
x 帰りで見た