In principle, nothing prevents taxpayers from fixing the documents themselves. (See para. 50 and also Twomey v. The Queen, (2012 TCC Pizzitelli).) But to have the corrections bind third parties (such as CRA), taxpayers often go to the provincial superior court for an order validating the changes back to the original agreement date. This is what the two groups of taxpayers in this SCC case did. The Quebec Court of Appeal allowed the backdated corrections; the Supreme Court of Canada agreed.
When asking a court to rectify your contracts, your first hurdle is to prove that the contracts really are wrong in that they don't reflect your true intention when you signed them. Often, it is not hard to prove the original intention and the errors documenting it because there are planning memoranda from accountants and lawyers, as there were in this case. (See e.g., paras. 36-39.) The question raised in this case was whether, under Quebec's Civil Law, the parties could retroactively correct their errors in a way that could bind the CRA and Revenu Quebec. The SCC said they could. (Para. 52.)
Ultimately, provincial courts cannot decide whether a federal tax assessment is valid. Only the Tax Court of Canada can decide that. (See para. 43 and 46; for provincial taxes, the provincial courts could decide the tax appeal but it would be a separate hearing.) But because "tax law applies to transactions governed by, and the nature and legal consequences of which are determined by reference to, the common law or the civil law" and because the provincial superior courts decide the common and civil law consequences of transactions, superior court rectification can practically determine a tax appeal. (See para. 45.) Be on guard, though: a rectification order won't help you if you haven't also filed a Tax Court appeal (which you may ask to have put on hold while you await a provincial court's rectification decision.)
Though the SCC affirmed the power of rectification, it warned that: "A taxpayer’s intention to reduce his or her tax liability would not on its own constitute the object of an obligation within the meaning of art. 1373 C.C.Q., since it would not be sufficiently determinate or determinable." (Para. 54.) To satisfy this principle, the parties should be able to show that they had agreed on a plan that "would, had [the documents] been drawn up properly, have made it possible to meet the objectives being pursued by the parties." (Para. 54)
See Quebec (Agence du Revenu) v. Services Environnementaux AES inc., (2013 SCC Lebel)