Honestly if I had to bet $$ I would guess the abs computer is dying.it should turn off, light a light....
So it's a hard failure or getting data till you cycle the switch.
Esp is typically just a function of the abs in most makes, it adds a gyro typically, looks at the steering wheel angle sensor and the path of the car..
Then depending on it can activate individual brakes to tighten a turn, etc
Kinda complicates things when other items are bad...it's why some shops won't work on older cars...if the clock spring is bad..which is not a steering angle sensors on most makes, but could be integrated in some(honestly don't know on a VW)...hell could it be sending info saying airbag deployment? Then as a safety feature the brakes lock up? Just spit balling cause this is definitely an odd case.
Know when my car got hit, the Porsche mechan deployed its airbags as it hit me then rolled a few feet then brakes locked up, shut off as I was spinning around,
Dashcam vid was priceless, showed the insurance company he was 100% at fault.