Two things:
1 - right now, “Auto” setting on the repair console is bugged; don’t use this setting
2 - you said you spent 17 mil on a ship; am I to assume you bought it from the Garage? If so, if the ship contains extra weapons, xeno steel (in an SV), or anything you couldn’t normally build yourself (an ATM on a CV/SV, gravity generator on SV, etc) then you can’t repair those if they are damaged and/or lost.
Unfortunately these expensive garage ships are not really suitable for this type of purpose, and if you take them into PvP you do so at your own risk without possibility of replacement.
Hope this was helpful info.