can anyone help to fix this error?

2nd image of the event graph

Running an “is valid” check is a common solution that may fix this

You have that cast to node there, unplug cast fail, and plug print there saying “cast fail for BP_sumting in Wahatever blueprint”

Pawn ssensing probably gives wrong actor referentce, or you casting to wrong class of pawn.