If you have tried all this and it still doesn't work, what you need to do is disable the "Wait for page to load" toggle on the Press button on web page action. It will then press the button and continue to the next action right away. When you do that, you can then actually send some keys, or use the Click element in window action or even Move mouse to image action - whichever works best for you. The trick here is that if Press button on web page is waiting for the page to load, and the pop-up appears, it will continue waiting infinitely and not allow the flow to continue, so that you could have a following action that closes the pop-up. That's why you need to make it not wait for the page to load, to be able to close the pop-up.
-------------------------------------------------------------------------
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.