I think it is bugged because:
a) There are sometimes negative upgrade costs shown,
b) if you have an up-to-date fleet and hover with the mouse over the upgrade button it will still show upgrade costs.
So something is clearly not working as intended.
It is possible to get a negative in the tool-tip if you downgrade a very expensive component with a cheaper one and the 25% refund is greater than the cost of the component. Not sure how the game actually handle such a case though.