Maybe this has been said already, just sharing my experience with this:
I had my starter ship in a new save, and found a crashed ship. It was an A-class fighter and looked very good except for the broken tech that I had no means of repairing just yet, being in the early-game. But I noticed that I had two options (as has been said here above): Buy for zero units, or Exchange. So I thought I’d give it a try and I bought it. I couldn’t fly it, it was broken as hell, but now I had two ships.
Forward three IRL days with several hours played in each day. I now have a freighter. I’ve jumped in and out of the freighter several times of course, and I never saw that other ship I once “bought”. I was sometimes trying to remember the planet where I had found and left it, and thought that it’s gone forever.
Anyway, when playing this morning, said A-class fighter had now spawned inside my freighter!
So - I really do have two ships, and the Buy (0 units) option actually works - albeit with a time delay. It’s still quite expensive to repair and I didn’t do it yet, but just to let you know that it works.
You can also summon your broken ship on any planet surface if you wish to see it or repair it, which might come in very handy!