I would check the codes, do you have a Check Engine Light coming on?
I have also replaced a few Mass Air Flow Sensors on the TDI Diesels for this issue, so be mindful of that.
RepairPal Certified shops can diagnose and repair your 2002 Volkswagen Beetle. They provide transparent pricing with a minimum 12-month or 12,000-mile warranty on repairs and services.