Your chip is powered from 2 power supplies, one 5V for the logic and one 24V to power the motor.
In your first sketch, current will always flow from 24V to 5V supply through an internal ESD protection diode inside the chip. When the fault comes off, the transistor will activate, bypassing the...