BMW USA (not sure what BMW Canada does) usually brings over 2 motors for the each series of vehicles. Usually during the middle of a models life, they replace both motors with newer power units so it helps to follow the lifecycle of different motors too.
While both have the N55, they have different version of it. The M235i has the N55B30O0 while the OG M2 had the N55B30T0, which I believe was the only bimmer to receive this iteration of the N55 (edit: the F26 X4 also had the T0).
Here is a link to a FCP article with the differences:
https://blog.fcpeuro.com/the-definit...specs-upgrades