I’m guessing he had a foolhardy plan to steal Vader’s lightsabre and it worked out far better than anticipated, judging by the look of shock on his face.
Yup. That, and he’s shocked to see wires dangling out of Vader’s severed head rather than blood.