The switch from iMessage to SMS happens with every iMessage that you send. The switchover is not permanent. It depends on the internet connectivity.
Maybe the iPhone to which you are trying to send an iMessage has deactivated iMessage for their SIM. This is another reason when the imessage switches to SMS

Connecting to Wi-Fi is the initial step, followed by establishing an internet connection.
However, it's important to note that connecting to Wi-Fi does not automatically guarantee an internet connection. In the event that you are unable to connect to Wi-Fi, the issue may stem from settings on your iPhone or the router/modem.
On the other hand, if you are unable to establish an internet connection despite being connected to Wi-Fi, the problem is likely related to the settings on your router/modem. In such cases, it is advisable to promptly contact your Internet Service Provider (ISP) for assistance.


Check your WiFi Router / Modem for --> Recommended settings for Wi-Fi routers and access points ...

For your Internet connection.
- Over Cellular: contact your Carrier (Cellular Service Provider). The agency that issued the SIM to you
- Over WiFI: Contact your ISP (Internet Service Provider), the agency that provided the Internet Service on your Modem/Router to you
However --> Connect iPhone to the Internet - Apple Support