Although no retreat fails if used a second time under normal circumstances, it is possible to use it more than once without failing if falinks is trapped before the first use, as stated by bulbapedia: “If the user has already been given the "Can't Escape" status by another move such as
Mean Look, No Retreat will successfully grant its stat boosts but will not create an additional status line to trap the user again. In this case, using No Retreat multiple times will create multiple boosts.”
The specifics of when no retreat does or does not fail is that the game checks if the user has a trapping status line caused by no retreat and NOT simply if no retreat has been used before. Of course, this is all guessing that patch 1.1 in sw/sh didn’t change this. This may also need testing before implemented in order to answer questions like “if falinks is freed after using no retreat, will the falinks become trapped by no retreat immediately or will that only happen if no retreat is used again?”