There are several ways of doing it. But you need to make sure that you do not go to the beginning of the loop, as that would restart the current item, and, as such, would put your flow in an infinite loop on the erroneous item. Instead, you must go to the end of the loop, effectively skipping the remaining actions within the current iteration, and move on to the next one.
You can either use an On block error action and put all of the actions inside the loop within the block. Then make the block continue the flow run on error and go to the end of the block:

This will handle all errors on all actions, though. If you only want to do this on the one particular action, you will need to create a Label at the end of your loop and then use the "On error" rules of the Click link on web page action as @MichaelAnnis suggested above.
Alternatively, you can also use a If web page contains action to check if the link exists before clicking on it. If it doesn't, you can use the Next loop action to skip any further actions and move to the next iteration.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.