Not that it is that important, but I thought you might want to know
![Smile :)](./images/smilies/icon_e_smile.gif)
Reproduce:
make a train LLCCLL (two locomotives, two cargo wagons, two locomotives)
Remove the second locomotive, you end up with L_CCLL
Re-add the locomotive into the space, the connection hints show that the new locomotive connects to both sides (see screen shot below)
Result: two trains, the connection is random
Expected result: one train LLCCLL
I reproduced it with only the creative mode mod active, just to be sure.
Edit: same happens if you try to insert a cargo wagon into two train parts