I’ve found a simple workaround for this on Xiaomi Android 14+.
Android 14 and above:
Unfortunately, there is no supported way to automate enabling Wi-Fi using the helper application. When attempting to toggle Wi-Fi through this method, the Android system always displays a confirmation prompt that must be manually accepted. This behavior is enforced by the OS, and currently, there is no known method to bypass it.