Hi i am RCIC and will answer this for you. if you applied for Study permit extension and now you study permit has expired when you applied for PGWP- then the answer is " you can not work until you get the PGWP"
2nd scenrio - only thing would change this is once you get your SP then you apply again for PGWP and withdraw the previous application.
the 3rd and the best scenario is if you applied for Study permit extension and apply your PGWP on the last day of SP (without completion letter or official transcripts) then you are eligible to continue working.
if you have any questions you can me at 780 938 5806 - Goraya Immigration.