Heya,
That's interesting about the squad size not updating after being hit by a train, i'll have to try to reproduce that myself and work out what is happening.
The units disappearing is a known issue which happens rarely, and is unfortunately a behaviour of the Factorio game itself and the fact the 'robot soldiers' are just modified biters in terms of their code and behaviours. Biters are deleted by the game if they have trouble path-finding in order to save CPU %, but the game doesn't know/care if the biters are on the player's team.
It's really hard to reproduce the issue, but I have seen it and reported it before and I was told "it's a feature not a bug" and they will not fix or modify the behaviour. Sorry about that!