I think I found a solution. We tried everything and nothing was working. The only thing that finally let our friend join without getting “connection timed out” was when we switched to a free shitty public wifi that was available instead of our usual wifi. Intrigued, i checked the connection settings for this public wifi and our usual wifi to see if there were any glaring differences. The main one that stuck out was that our ps5 was on 2.4ghz band and this public wifi was on 5ghz band. So i switched our usual private wifi to 5ghz and then invited our friend…and it finally worked!
To do this on your ps5 go to Network > Settings > Set Up Internet Connection. Hover over your current network, then press the Options button and choose Advance Settings > Wi-Fi Frequency Bands. Switch the option from “Automatic” to “5 GHz”
Lemme know if that helps you all too!