No way to predict what CBSA might do, they probably will just wave you through on basis you still have a valid visa/work permit as the onus is on the individual to remain legal either with a new visa/permit or extend stay as a visitor. The validity of your passport to 2027 not really as relevant as the expiry of your visa/permit.