App minimises while test is running

I am running appium-robotframework test with Android mobile (real device). While running, the app suddenly minimises causing test case to fail.
There is no entry in logs related to this action and due to which I am not able to resolve it.

Appium version: 2.1.3
Python: 3.11
Robot Framework version: 6.1.1
Android version: 13