> would a court of competent jurisdiction strike that clause [...]?
Probably not.
The following is a simplification and approximation.
A contract is a legally enforceable promise. What turns a promise into a contract is "consideration".
I don't want to delve too deeply into this because something like 80% of the Contracts class in law school is trying to figure out what the heck "consideration" actually is but roughly it is a promise, action, or restraint from action bargained for by a promisor in exchange for the promise.
In this case, Tesla (the promisor) is promising to transfer ownership of a Cybertruck to the buyer and in exchange for that promise wants the buyer to pay money and restrain from reselling the Cybertruck within a year.
What seems to get people hung up is that if you own something you can generally legally sell that thing. But that's what makes agreeing not to sell work as consideration. Consideration has to have some value.
If the purported consideration is doing an action that you were already legally obligated to do or refraining from an action that you would not have been legally allowed to take it does not have sufficient value to work as consideration.
Agreeing to refrain from an action you can otherwise legally take is fine as consideration.