I am replacing my earlier post about RCS versus SMS/MMS as follows:
SMS/MMS texting uses your cellular connection (or WiFi Calling if it is working properly), never WiFi alone. Most carriers have size limits which area generally either 600kb or 1.2 MB. Some carriers will attempt to compress a photo if necessary to send as an MMS, but if the receiving carrier does not support the compressed photo or the size of the MMS, it may not go through. Also, on the receiving end, you will not recieve any SMS/MMS texts unless you have a cellular connection or have a working WiFi Calling connection, never on WiFi alone
If having WiFi on seems to be causing problems it could be that your phone might be trying to use WiFi Calling which is not working properly and is causing the problem, or your phone is trying to use an advanced messaging app such as google messages that is not current or not set up properly.