Hello,
The below article has steps for when an iPhone is having Wi-Fi issues. I coped the last step below since you mentioned what's instructed in the step before this one.
If your iPhone or iPad won't connect to a Wi-Fi network - Apple Support
"Reset your network settings
If you're using iOS or iPadOS 15 or later, tap Settings > General > Transfer or Reset [Device] > Reset > Reset Network Settings.
If you're using iOS or iPadOS 14 or earlier, tap Settings > General > Reset > Reset Network Settings.
This also resets Wi-Fi networks and passwords, cellular settings, and VPN and APN settings that you've used before."
I hope this helps.