Auto Off Bluetooth app
A simple Android app to automatically turn off bluetooth if disconnected.No configuration, should work as-is, no guarentees and might need you to disable battery optimization for the app. For recent versions of android, it seems to need to be launched at least once for it to work.
If BT is disconnected and reconnected quickly, the app will avoid disabling unnecessarily.