Unable to toggle wifi off

I test automation python code to toggle the wifi off on my iphone7 but failed.

The python code in Library :-

def toggle_wifi(self, mossDriver, action):
    try:
        self.lib.write_log('INFO', "Toggle Wifi: " + action)
        mossDriver.addons().execute(IosNetworkOperations.wifi(expectedState=action))
    
    except:
        self.returnStatus = False
        self.returnMessage = "Toggle Wifi - Error: " + str(sys.exc_info()[0]) + str(sys.exc_info()[1])
        self.lib.write_log('ERROR', self.returnMessage)
    else:
        self.returnStatus = True
        self.returnMessage = "Toggle Wifi - Passed"
        self.lib.write_log('INFO', self.returnMessage)
    finally:
        return self.returnStatus

Call the function in test script :-

self.oMoss.element_wait_xpath_presence(mossDriver, “”, self.oMoss.pom_moss.ONLINE_LABEL)
if self.oMoss.returnStatus == True:
self.oMoss.toggle_wifi(mossDriver, “OFF”)

I did installed the addon “IOS Network Operations”.
image

Log:
2022-06-07 08:25:22,111 - ERROR - Toggle Wifi - Error: <class ‘src.testproject.sdk.exceptions.sdkexception.SdkException’>Error occurred during addon action execution: java.lang.NullPointerException at io.testproject.addon.ios.network.Actions.Toggles.WiFi.execute(WiFi.java:25)