@Colin ********
what you are trying to say is:
If you have a non-o-visa reason for extension is married to Thai, when you partner passes away, your reason for extension is gone.
You will have to change your reason for stay to something else.
It will depend on age, finances etc.
You would switch to:
Take care of Thai child.
Retirement.
Maybe dependant of your Thai child.
Nonb work
Or whatever you qualify for.
Technically when you spouse passed that's it.
Immigration is sympathetic, will try and help.