You need to find out if the rear cogs rotate freely when this crank rotation is going on. If the cassette is moving freely like that, you need to service or replace your freehub. My guess is that the pawls inside are gunked up, and cannot always engage the ratchet teeth to give you forward momentum.