Having issue with consistency

Never touch(*) a motor leads to any driver circuit. Connect securely first, then power up the driver circuit.

Similarly power down the driver before disconnecting any inductive load such as relay or motor.

(*) Inductive loads will generate high voltages and arcing if handled in this manner (you can even give yourself
a painful shock - with large motors you can give yourself a dangerous shock). Driver circuits don't like
arcing at their contacts, it tends to fry them.

You haven't mentioned any motor driver - you do have a motor driver?