How to toggle a button using URL?
Apple does not provide the ability to change settings in the Settings app by a URL.
You can only navigate to a page within the app for you to switch the setting yourself as you've found. A URL that could toggle a setting could be a security issue in that the URL could be navigated to by a bad third-party and toggle a setting without your permission.
Actions in the Shortcuts app like the Wi-Fi and Bluetooth toggles use private APIs only available to apps with specific Apple private entitlements.