Would you be able to try changing that check to see if it fixes the issue?
You can also try checking for both, like in this example.

Another question is how do I switch to another flight mode when I’m in depth hold mode?
I’m not sure what you mean by this. Depth hold is a flight mode. If you have a mode change function that allows you to change into it, you should be able to use the same function to change into a different mode
By the way, you seem to have print(<number>)
calls littered throughout your code, including re-using the same numbers in multiple files. I’d recommend instead using the logging
module, which comes with Python.