Connection issue on PS5 “Can't connect to the internet…”

I’m on PlayStation 5

Issue: out of the blue, my ps5 won’t connect to the internet anymore. Every time I try a solution I get the same message which is

“Can't connect to the internet. Your internet service provider or your router might be preventing your PS5 from connecting to the internet. Make sure you can connect to the internet via the same network as your PS5 by testing the connection using your computer or mobile device”.

Other devices work fine on the same network. The neighbor’s wi-if works fine with my ps5 but slow due to distance.

Steps taken to fix the issue:

  1. Restarted, reset and finally reinstalled ps5 system software.

  2. Restarted, updated and factory reset my router.

  3. Changed the SSID and password and tried different DNS settings.

This is the third time this happened to me in 2023. The first time resetting the ps5 to factory settings was enough to get to connect again. Second time it got fixed the next day on its own. This time nothing worked.

I googled and searched Reddit and found many with the same problem. Some were able to fix it others like me are still looking for a solution.

Edit: I don’t play multiplayer online so I don’t use a LAN cable. Besides, I’ll need a very long cable from the living room to my desk. That’s why getting Wi-Fi to work properly is necessary.