There is ample precedent that the Court should not rewrite the laws, yet the Roberts Court did so. The only guard against that is to have the Senate do its job when giving its "advice and consent" to presidential appointees; even that does not always work because justices change their views over time and due to desires to do what is "right." They rarely should but they do.
No President is prescient about what a Supreme Court appointee may do years after he is confirmed, and neither is the Senate. I don't know of any solution beyond electing Presidents and CongressCritters who will do their best, imperfect though it may be, to avoid that sort of thing. And that's up to us.
I know what you are saying, but it does not change the situation. If someone is taken to court over a crime of stealing a candy bar, the court cannot judge that person for a different crime, say using the pay toilet and not paying, unless that crime is specifically addressed in the summons, basically rewriting case and never rendering a decision of candy bar theft.
My point still stands, the supreme court was not tasked with determining what to call the individual mandate, they were tasked on whether or not it was constitutional.