Error on click on location permission dialog on iOS 15.0

Hi all,

I am facing a strange issue on a Mac Pro with appium server 2.0.0-beta.18 installed.
On another Mac I have no issue.
The two Mac differs beacause I have a differente version of Xcode installed on.

Can you pls help me to solve this issue ?
What should I do ?

Following the appium server running on my Mac Pro:

[Appium] Welcome to Appium v2.0.0-beta.18
[Appium] Non-default server args:
[Appium] allowCors: true
[Appium] tmpDir: /var/folders/ql/yg1p1wrn4p74t9z937csh23m0000gp/T
[Appium] Attempting to load driver xcuitest…
[Appium] Attempting to load driver uiautomator2…
[Appium] You have enabled CORS requests from any host. Be careful not to visit sites which could maliciously try to start Appium sessions on your machine
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[Appium] Available drivers:
[Appium] - [email protected] (automationName ‘XCUITest’)
[Appium] - [email protected] (automationName ‘UiAutomator2’)

When I start the test I launch successfully the APP but then when the location permission dialogue is shown I got this HTTP 500 error from Appium trying to click on an element:

[HTTP] <-- POST /session 200 100337 ms - 584
[HTTP]
[HTTP] --> POST /session/1022290b-7da9-4489-a02c-4d9110798a20/element
[HTTP] {“using”:“accessibility id”,“value”:“Non consentire”}
[debug] [W3C (1022290b)] Calling AppiumDriver.findElement() with args: [“accessibility id”,“Non consentire”,“1022290b-7da9-4489-a02c-4d9110798a20”]
[debug] [XCUITest] Executing command ‘findElement’
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [WD Proxy] Matched ‘/element’ to command name ‘findElement’
[debug] [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/A9B86B21-9790-44C6-8E89-899BE8227010/element] with body: {“using”:“accessibility id”,“value”:“Non consentire”}
[debug] [WD Proxy] Got response with status 200: {“value”:{“ELEMENT”:“6F000000-0000-0000-3404-000000000000”,“element-6066-11e4-a52e-4f735466cecf”:“6F000000-0000-0000-3404-000000000000”},“sessionId”:“A9B86B21-9790-44C6-8E89-899BE8227010”}
[debug] [W3C (1022290b)] Responding to client with driver.findElement() result: {“element-6066-11e4-a52e-4f735466cecf”:“6F000000-0000-0000-3404-000000000000”,“ELEMENT”:“6F000000-0000-0000-3404-000000000000”}
[HTTP] <-- POST /session/1022290b-7da9-4489-a02c-4d9110798a20/element 200 235 ms - 137
[HTTP]
[HTTP] --> POST /session/1022290b-7da9-4489-a02c-4d9110798a20/element/6F000000-0000-0000-3404-000000000000/click
[HTTP] {“id”:“6F000000-0000-0000-3404-000000000000”}
[W3C (1022290b)] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command ‘proxyReqRes’
[debug] [WD Proxy] Matched ‘/session/1022290b-7da9-4489-a02c-4d9110798a20/element/6F000000-0000-0000-3404-000000000000/click’ to command name ‘click’
[debug] [WD Proxy] Proxying [POST /session/1022290b-7da9-4489-a02c-4d9110798a20/element/6F000000-0000-0000-3404-000000000000/click] to [POST http://127.0.0.1:8100/session/A9B86B21-9790-44C6-8E89-899BE8227010/element/6F000000-0000-0000-3404-000000000000/click] with body: {“id”:“6F000000-0000-0000-3404-000000000000”}
[WD Proxy] Got response with status 500: {“value”:{“error”:“unknown error”,“message”:"*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil",“traceback”:"(\n\t0 CoreFoundation 0x00007fff203feba4 __exceptionPreprocess + 242\n\t1 libobjc.A.dylib 0x00007fff201a1be7 objc_exception_throw + 48\n\t2 CoreFoundation 0x00007fff2047ef64 _CFThrowFormattedException + 194\n\t3 CoreFoundation 0x00007fff2047cbf9 -[__NSArrayM insertObject:atIndex:].cold.2 + 0\n\t4 CoreFoundation 0x00007fff202faaee -[__NSArrayM insertObject:atIndex:] + 1095\n\t5 XCUIAutomation 0x000000010a7b959f __104-[XCAXClient_iOS interruptingUIElementsAffectingSnapshot:checkForHandledElement:containsHandledElement:]_block_invoke + 1362\n\t6 XCTestCore 0x000000010a27d9ad -[XCTContext _runActivityNamed:type:block:] + 245\n\t7 XCTestCore 0x000000010a27cb70 +[XCTContext runInternalActivityNamed:block:]…
[debug] [W3C] Matched W3C error code ‘unknown error’ to UnknownError
[HTTP] <-- POST /session/1022290b-7da9-4489-a02c-4d9110798a20/element/6F000000-0000-0000-3404-000000000000/click 500 311 ms - 787

I am also facing similar error when click on Requesting push Notifications popup