Mine did the same a couple of years ago. In my case it was metal shavings in the mag housing shorting out stator. I vacumed out housing and it fixed the problem. Service manual has ohm test to check the stator.
Small metal shavings tend to collect in there, larger chunks can be from starter bendix, worn teeth, etc.
First unplug vts module and try again before going to the trouble of opening up mag housing.