Xcode Bot: Test assertion, Timed out while synthesising event

Desciption:
The UI tests work on the local machine (Mac mini), but not on the Xcode server. The Mac mini is also used for the Xcode server. For some integrations on the server, some UI tests work, but often they fail again for the next integrations.
iOS simulators and devices were used when running the UI tests. The error usually happens when typing into a textfield.

Some people suggested to modify the "setUp" and "tearDown" functions to this:

override func setUp() {
        XCUIApplication().terminate()
        super.setUp()
XCUIApplication().launch()
}

override func tearDown() {
super.tearDown()
XCUIApplication().terminate()
}

But that also didn't work.

I don't understand why the UITests don't work on the server, but do work on the local machine without the server.

Error:
Bot Issue for ProjectXYZ (test assertion in MovieTests.testXYZ()) Integration #1 of Bot on Mac mini Test Failure: Failed to synthesize event: Timed out while synthesizing event.

Server-Environment:
Mac mini (2018)
Server API v19
Xcode 12.4
macOS 11.2.3
Server 5.11



I have similar problem on new mac mini M1, when I tap onto textField and software keyboard should come up, but it doesn't. Funny thing is that same test is working on Intel mac with no problem and I also have disabled hardware keyboard in simulator.
To add more funny things, if I erase simulator first of tests will always work, but next one or on repeated run it is a lottery.
Should we make bug ticket for Apple? I think this is something wrong on simulator on M1 macs.
Xcode Bot: Test assertion, Timed out while synthesising event
 
 
Q