My friend did that.
He applied from Canada and went back to India due to medical emergency. He got valid study permit till 30th Aug 2023 and he applied for his PGWP in May 2023 then he went to India in June 2023 and still there meanwhile his PGWP got approved and he stamped his passport ( TRV ) in India and he is going today.