Enabling the infinite lives code with 0 remaining lives does not allow you to restart a stage since, technically, you have no lives left. This shouldn't happen as you have "infinite lives", so in theory you should be able to restart as many times as you want.
Unsure what the behaviour is with the "Disable Life Loss from Restart" code but it should also not prevent you from restarting when you have 0 lives.