Unable to find elements in page after setting time with native Android time picker

I’m building tests to Android app with Appium and encountered the following problem.

As part of the flow I need to set desired time with Android native time picker, the problem is when I’m clicking on “ok” button (“button1”) in Android time picker in order to get back to the main screen of the app.

I’m able to get to the main screen (visually) but any further attempt of searching element by id is failing (this is the error that I’m getting):

org.openqa.selenium.NoSuchElementException: Can’t locate an element by this strategy: By.chained({By.id: endTime})

I have tried everything including trying to put the app in background and re-entering is again- I thought maybe it will load the page better…didn’t work either…

Also tried ti use wait -thinking maybe the page wasn’t load completely- didn’t work as well

would really appreciate your help.