You cannot permanently prevent the invincibility cheat from turning off in Red Dead Redemption.
The cheat is designed as a temporary effect that expires after a set time or upon taking significant damage. This prevents abuse and preserves the intended challenge.
Enjoy the game the way it was designed for the most immersive experience.