Custom initrd Going Into Recovery Mode

Your comment sounds like recovery image. But not recovery mode.

We have a counter as what you found there and if specific script didn’t clean up the timer for consecutive 3 times, then it will enter recovery boot.

You can also use this method to give it back to direct boot.