So you'd be stuck in a country you don't live in?
What do you expect? Unless you are traveling to visit relatives in your home country or something similar, you shouldn't be traveling. If you don't have a valid visa to come back, that would be on you for traveling without one. Also, if you don't have a valid visa, how on earth do you want to be able to travel to Canada?
They would need to transfer the file to the corresponding Visa office in or near the country where you are at. They would have you send your passport print a visa (counterfoil) and send your COPR along with it. Then, and only then you'd be able to travel back.
If you do have a valid visa to travel, you can simply travel back with it. They might simply complete your landing at the port of entry or you will complete that process ever coming back as those who are in Canada normally do.