I have seen the programming screw up and do this, normally the unit is also stuck and cannot move.
but I had a tank move into a building once and also get stuck.
I also recall someone tricking the system and getting it to happen once in a scenario they designed. but I am not sure if it can even be done that way in a manor that it can be set up consistantly to do such a thing.
Anyway, good luck, the programming is not designed for you to spot it, like was said, maybe if the building is destroyed first.