You went wrong the first time you used the word 'energy'!
It is sort-of OK to say instead that magnets are a free source of 'force'. So make that correction and let's move on.
Next point: You only get energy out when the force moves
. So do that and there's your useful energy. OK up to here: everything is fine if you just correct that little energy/force typo. Yes, you will get energy out!
The problem comes in at the next step, because you have to push the magnet back to the original position [or rotate a shaft, which comes to the same thing], in order for it to be ready for the next extraction of energy. And the afore mentioned 'push' is a force. Sadly, it is exactly the same as what you took out before, and don't you go thinking that gearing or levers can solve that because it can't.
It's like a cookie jar: you can only take out what someone else has already put in. You can try preload the system with stronger magnets to start with [more cookies in the jar], and that will give you more energy to drive with, but eventually someone has to replenish it if you want to keep going [fire up the oven and do some more baking].
Your only workable option is to have super-super strong magnets [don't yet exist] that can drive the car for the whole day, and then at night you plug it in and an incredibly strong electric motor [which of course consumes energy] forces the magnets back into position and in doing so recharges the system with energy.
What you initially proposed is what we call a perpetual motion machine. I've seen a few in my time, often a lot more detailed, e.g. down to detailed drawings and even some models, and the root of their problem is always the same little misunderstanding about force vs. energy.
Thanks for trying with the suggestion ... I can see it was well meant.
Dirk Pons
PS: Don't you go wasting your time on trying to perfect and patent it now, but if you really believe it is worth spending all your free time and savings on this pursuit [as I have seen many do, so you would not be the first] then please get yourself a NDA form off the web and take the idea to a professional mechanical engineer for an independent evaluation.