I’m sorry to hear of the circumstances. We’ve not generally seen much of it with the Moto G4 specifically but on older Republic compatible phones if the WiFi toggle does not turn on and stay on it may be indicative of failed WiFi hardware in the phone.
As a starting point, I suggest placing the phone in safe mode as described by Republic here:
Safe mode is not intended to be a solution. It’s a diagnostic test. With the phone in safe mode, does the WiFi toggle turn on and stay on?
If WiFi still toggles itself off; does the same thing happen when toggling Bluetooth?