This bug seems to be unrelated to all earlier duplication issues that I could find, but if this has already been reported, I apologise.
Bug: If a ship is docked at a station and the refit screen is used, the refit screen will load weapons from both the ship's cargo and the station's; and, if these are removed, it will return them to their origin unless the user exits the refit screen. If a ship variant is loaded, equipped weapons that already match the variant will not be removed - and those that do not, will. However, if weapons are equipped from a station using the refit screen and, without leaving the refit screen, a variant using these weapons is then loaded, weapons will both be left equipped on the ship and returned to the station.
To reproduce:
1. For a given ship variant, store the required number of each weapon in the Abandoned Storage Facility.
2. Load the desired ship variant via the "Manage Variants" list.
3. Without leaving the refit screen, load the same variant again.
4. The ship's weapons will be added to the station's cargo, as if they had been removed from the ship, but will not in fact be removed from the ship.