SendKeys not working - WebDriver timeout

Hello everyone,

testing on: iOS Simulator
language: python
Environment: Mac OSX, appium 1.20.2, iOS 14.3

I have the following Problem: I have a Python script to test an App, after a few actions I will try to enter an email address, sometimes this actions fails with the error below, sometimes It won’t. It has to be said that a new overlay opens to enter the email address. I can determine if a run will fail as soon as the overlay opens, because on a failed run no keyboard pops up (on a successful one it does). But if I add a tenth of a second delay before entering the email address it works fine every time. Also on a failing run when I click on the textfield manually the keyboard Pops up and some of characters will be entered (the first like 4-8 are missing most of the time). I suspect the error happens because the keyboard isn’t there but I am not a hundred percent sure. On the other Hand I wasn’t able to reproduce the error with other Apps and I am using a React Nativ app and therefore it is kind of “slow”(not visible to the eye). So maybe it is because the app(on some runs) isn’t “ready” to take input when appium try’s to send the keystrokes. Using the sleep method kind-of sucks because it unnecessarily slows down testing.
Is this a Bug ?
Implicit wait is set to 5 (seconds)

Any help would be appreciated (especially if you can tell me if the error is on my side or if I should open a bug/issue)

Snippet of Code in question
driver.find_element_by_ios_predicate('type == "XCUIElementTypeTextField"').send_keys("[email protected]")`
deviceName='iPhone Simulator',
newCommandTimeout = '3000'))
[HTTP] --> POST /wd/hub/session/14456ea5-293c-49db-bd59-b2a4e9d2fdfc/element
[HTTP] {"using":"-ios predicate string","value":"type == \"XCUIElementTypeTextField\""}
[debug] [W3C (14456ea5)] Calling AppiumDriver.findElement() with args: ["-ios predicate string","type == \"XCUIElementTypeTextField\"","14456ea5-293c-49db-bd59-b2a4e9d2fdfc"]
[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
[debug] [BaseDriver] Waiting up to 5000 ms for condition
[debug] [WD Proxy] Matched '/element' to command name 'findElement'
[debug] [WD Proxy] Proxying [POST /element] to [POST] with body: {"using":"predicate string","value":"type == \"XCUIElementTypeTextField\""}
[debug] [WD Proxy] Got response with status 200: {"value":{"ELEMENT":"D0000000-0000-0000-744F-000000000000","element-6066-11e4-a52e-4f735466cecf":"D0000000-0000-0000-744F-000000000000"},"sessionId":"3592AAA8-39DC-4DFD-A6BE-DB12D7A100CB"}
[debug] [W3C (14456ea5)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"D0000000-0000-0000-744F-000000000000","ELEMENT":"D0000000-0000-0000-744F-000000000000"}
[HTTP] <-- POST /wd/hub/session/14456ea5-293c-49db-bd59-b2a4e9d2fdfc/element 200 150 ms - 137
[HTTP] --> POST /wd/hub/session/14456ea5-293c-49db-bd59-b2a4e9d2fdfc/element/D0000000-0000-0000-744F-000000000000/value
[HTTP] {"text":"[email protected]","value":["t","e","s","t",".","t","e","s","t","@","p","a","p","i","e","r","k","o","r","b",".","m","e"],"id":"D0000000-0000-0000-744F-000000000000"}
[debug] [W3C (14456ea5)] Calling AppiumDriver.setValue() with args: [["t","e","s","t",".","t","e","s","t","@","p","a","p","i","e","r","k","o","r","b",".","m","e"],"D0000000-0000-0000-744F-000000000000","14456ea5-293c-49db-bd59-b2a4e9d2fdfc"]
[debug] [XCUITest] Executing command 'setValue'
[debug] [WD Proxy] Matched '/element/D0000000-0000-0000-744F-000000000000/value' to command name 'setValue'
[debug] [Protocol Converter] Added 'text' property "[email protected]" to 'setValue' request body
[debug] [WD Proxy] Proxying [POST /element/D0000000-0000-0000-744F-000000000000/value] to [POST] with body: {"value":["t","e","s","t",".","t","e","s","t","@","p","a","p","i","e","r","k","o","r","b",".","m","e"],"text":"[email protected]"}
[WD Proxy] Error: timeout of 240000ms exceeded
[WD Proxy]     at createError (/usr/local/Cellar/appium/1.20.2/libexec/lib/node_modules/appium/node_modules/axios/lib/core/createError.js:16:15)
[WD Proxy]     at RedirectableRequest.handleRequestTimeout (/usr/local/Cellar/appium/1.20.2/libexec/lib/node_modules/appium/node_modules/axios/lib/adapters/http.js:280:16)
[WD Proxy]     at Object.onceWrapper (events.js:422:26)
[WD Proxy]     at RedirectableRequest.emit (events.js:315:20)
[WD Proxy]     at ClientRequest.eventHandlers.<computed> (/usr/local/Cellar/appium/1.20.2/libexec/lib/node_modules/appium/node_modules/follow-redirects/index.js:13:24)
[WD Proxy]     at ClientRequest.emit (events.js:315:20)
[WD Proxy]     at Socket.emitRequestTimeout (_http_client.js:784:9)
[WD Proxy]     at Object.onceWrapper (events.js:421:28)
[WD Proxy]     at Socket.emit (events.js:327:22)
[WD Proxy]     at Socket._onTimeout (net.js:483:8)
[WD Proxy]     at listOnTimeout (internal/timers.js:554:17)
[WD Proxy]     at processTimers (internal/timers.js:497:7)
[debug] [W3C (14456ea5)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded
[debug] [W3C (14456ea5)]     at JWProxy.command (/usr/local/Cellar/appium/1.20.2/libexec/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:275:13)
[debug] [W3C (14456ea5)]     at runMicrotasks (<anonymous>)
[debug] [W3C (14456ea5)]     at processTicksAndRejections (internal/process/task_queues.js:93:5)
[debug] [W3C (14456ea5)]     at XCUITestDriver.proxyCommand (/usr/local/Cellar/appium/1.20.2/libexec/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:96:12)
[debug] [W3C (14456ea5)]     at XCUITestDriver.setValue (/usr/local/Cellar/appium/1.20.2/libexec/lib/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/element.js:152:5)
[HTTP] <-- POST /wd/hub/session/14456ea5-293c-49db-bd59-b2a4e9d2fdfc/element/D0000000-0000-0000-744F-000000000000/value 500 60039 ms - 102