I think this is a big problem.
For ex. I have 26 workers on my microchip factory but when i upgrade it to advanced all my workers are leaving.
I think this is a problem and you have solve it
When we upgrade a building, we destroy the old one, and build the new one using the resource of the first building. Once the old building is gone, the workers need to leave the "place". Is not a problem, is not a bug, is just logical. :P
building1: 500 water, building2: 1000 water, 400 aluminium.
If you do the upgrade, you will need 500 water and 400 aluminium.