Yes, and it strands students every year. Your study permit lets you study in Canada. It is not a travel document and it does not board you on a plane. To come back after your trip, the visa (TRV) in your passport must still be valid. The permit and the visa run on separate clocks, and many students' visas expire before their permits do.
Before you book:
- Study permit valid well past your return date.
- Visa (TRV) sticker in your passport still valid for re-entry. Check it now.
- Carry proof of enrolment back with you, because returning students can be asked about their studies at the border.
If your visa has expired, apply for a new one from your home country before you fly, not after the wedding.
This is community experience, not legal advice. For your own file, speak to a licensed consultant or lawyer.