I had the following problem when upgrading a ship design that I had created from scratch:
Upgrading tiny ship that I was using as a scout. I had researched some new improvements that were smaller than what was on the existing design. I clicked on one of the components and clicked the Remove button. It appeared to work, and the "space points left" bar was updated correctly. I repeated with another component. Now, I attempted to add a new component that the "space points left" bar showed exactly enough space for. I got the popup saying that I did not have enough room for the component.
NOTE: If I rebuild the whole ship design from scratch, using the same components, it works. This bug is related to the Upgrade interface not releasing space points when a component is removed. It is odd that the display DOES show the correct numbers during this process.