My student visa also expires on the same date my study permit expires on.Is your temporary resident visa still valid and will be valid beyond August 27th? If so you can leave without any worries and most likely they will let you enter as a visitor since you won't have received the permit in hand by then.
If not, you should apply for an extension of your TRV based on the fact that you have applied for a work permit. That's my understanding. Wait for expert's opinion.
Pretty much I won't be able to apply for an extension of my current TRV since I graduated so I guess I should apply for a visitor visa.
Thank you for your reply, I really appreciate it