Is this on one ticket or two? This is important. If you are on one ticket and your luggage is through checked you can, in theory, stay airside, but this will be a most unpleasant experience for ca 22 hours. If you are on two tickets you will probably have to collect your luggage, which means entering Canada and following entry requirements, including a test and ArriveCan, and eTA, if you require one. You do not need to write a novel about quarantine procedure, just have a plan. You can leave Canada at any time. Does your European country require an entry test?