'-는 길에' means "on one's way"
It is used for physical action of coming or going.
It has nuance of "drop into something"
'-는 김에' means "since one does something"
It is used for any kind of action.
It has nuance of "make good use of opportunity and do something"
ex)
은행에 가는 길에 장을 봤다(O)
On my way going to the bank, I did grocery shopping.
은행에 가는 김에 장을 봤다(O)
Since I was going to the bank, I did grocery shopping.
오신 길에 저녁이나 같이 하시죠(X)
오신 김에 저녁이나 같이 하시죠(O)
While you're here, why don't you have dinner with us?
말 나온 길에 부탁 하나 할게요(X)
말 나온 김에 부탁 하나 할게요(O)
Since[Now that] you've brought it up, I will ask you a favor.
음식을 가져오는 길에 맥주도 가게에서 사다 주세요.(O)
음식을 가져오는 김에 맥주도 가게에서 사다 주세요.(O)
Both are correct but the nuance is different from each other.