Reproduction steps:
- Build a station with a loose module and a unit module.
- Assign whatever items to the modules.
- Quick-replace the unit module with a loose module by holding shift and building over it.
- The station window now still shows the old item with 0/0.
Works every time for me.

Here's a save with the station shown above.
A work-around is to place the old module back, un-assigning the item, and then replacing it again.