IOS doesn't allow any application to change the focus mode. This application gives the name Focus to Shortcuts app. Shortcuts is able to switch.

To do the configuration, you have three steps: