Q: or did you instinctively write the weird chords leaving the key after writing the parts in F and then go to D major without intending to,
A: yes