Idle issues when in gear

also check you wires and coil.

Car would do similar. Hv lwad from coil would arc occasionally to lv posts on coil. Hv lead wasnt seated in there properly. Easy to see at night