When you place a train blueprint, and then manually place the train afterwards, it won't replace the ghost.
Robots will still attempt to build the train, and when you move the blocking train, they will attach the wagons they are attempting to place onto the departing train.
[0.17.3] Placing train on train ghost does not remove ghost
Re: [0.17.3] Placing train on train ghost does not remove ghost
This was most probably fixed. Let me know is it still happens.