Check to see if the info on your local WiFi network IPV4 Address network has become corrupt if you have Configure IP > automatic. I had similar troubles as noted in various replies with my home WiFi network with an iPhone X after update to iOS 18.3.2. I tried various restarts, airplane toggle, disconnect/reconnect, and finally did the Forget This Network. I found that the IPV4 network info was 169.254.187 not the 192.168.1 that my local network uses.
Details after the Forget This Network, I selected the same local network again. I used the Share Password from a MacBook also on the same network (192.168.1.*) and the share appeared to succeed. However, the iPhone X never successfully connected. I looked at the IPV4 and it showed IP Address 169.254.187.170, subnet mask 255.255.0.0, and blank for Router.
Workaround for me was change from Configure IP from Automatic to Manual, pick an unused IP address for my local network 192.168.1.170, set subnet mask 255.255.255.0, and set router to 192.168.1.254. After successfully connecting to the local network, I was able to also change the Configure IP back to automatic and it updated the IP address 192.168.1.161, but retained the correct subnet mask and router.
Not clear to me if the issue was in iOS 18.3.2 handling of the Shared Password or fails to correctly determine what local private network addressing is in use and just defaults to 169.254.187.*
I was able to duplicate this problem scenario. After forgetting the network and then using sharing password again with the iPhone X it had the same incorrect IPV4 address information each time.
I'm using an AT&T Lightspeed modem/router setup for a local network of 192.168.1.* with router 192.168.1.254.