I realise there are probably numerous reasons for this, but in my case it was a simple fix as follows:
In ‘settings’, ‘phone’ (under iOS 18 its under ‘Apps’, ‘phone’) ‘My Number’ was blank. Once corrected and phone restarted, the Wi-Fi calling started working perfectly. So worth a look if you have the same problem!