Exhibit 5.1

Consent of Independent Registered Public Accounting Firm

We consent to the reference to our Firm under the caption “Experts”, and to the incorporation by reference in the Registration Statement on Form F-10 and related short form base shelf prospectus of ATS Corporation (the “Company”) dated April 27, 2026 of our reports dated May 29, 2025, with respect to:

 

   

the consolidated statements of financial position as of March 31, 2025 and 2024 and the consolidated statements of income (loss), comprehensive income, changes in equity and cash flows for each of the years in the two-year period ended March 31, 2025; and

   

the effectiveness of internal control over financial reporting of the Company as of March 31, 2025,

included in the Company’s Annual Report on Form 40-F/A (Amendment No. 1) for the year ended March 31, 2025, filed with the Securities and Exchange Commission.

/s/ Ernst & Young LLP

Chartered Professional Accountants

Licensed Public Accountants

Toronto, Canada

April 27, 2026