Look for somewhere the wire harness is contacting ground, likely due to the engine shifting when being placed in drive. Pay close attention to sharp metal edges, brackets, braces, etc. It sounds like you have a non static problem so testing when things are sitting still won't show it and testing when the car is in gear is pretty difficult.