purely a guess but sounds like its not getting enough air or fuel.
So, logic would tell me to check the fuel pump is working ok, and maybe air flow sensor?
Maybe thinking more the sensor as you are getting it when its warm and its breaking down then.
Maybe a call/trip to the scrap yard/ vw breakers for a price on a cheap used one?
Dont count me on that though lol.