You say that it works with the initial connection, so think you are actually seeing a different issue here. When you put the AirPods Max aside (or take regular AirPods out of your ears), macOS does not see that as disconnecting. And it does not see putting them back on as connecting.
The Improve sound quality option only comes into play when macOS says that the device is connecting. If the sound input changes but macOS does not report that the device is connecting, ToothFairy won’t notice and so won’t fix the sound input.
So I think the question is, why is the sound input changing when the AirPods remain connected? (On my Mac, removing but not disconnecting the AirPods does not change the sound input setting in System Preferences.) Are you able to figure out when this is happening and if it’s linked to particular software or actions on your Mac?
Regardless, you can probably work around the problem by tapping the hotkey twice so that ToothFairy disconnects and then connects the AirPods.