Unresolved promise

Hi all,
on a website I have the following situation:
I enter a value in a field and click on a button afterwards. Depending on the validity of the input there will either show up an additional view or an alert pop up with an error message.

In this case I tried
${promise} = Promise To Wait For Alert action=accept
Wait For Elements State ${VISIBLE} state=visible
${text} = Wait For ${promise}
Fail ${text}

Both branches of the TRY/EXCEPT block work so far except for the fact that the “promise” was not solved in the first block. Therefore I get the following messages:

WARN Waiting unresolved promises at the end of test ‘XXX’
ERROR Calling method ‘_end_test’ of listener ‘Browser’ failed: Error: page.waitForEvent: Target page, context or browser has been closed
=========================== logs ===========================
waiting for event “dialog”

Does anyone have an idea how this problem could be solved? I would be very delighted if someone could help!

I used the latest versions of RF and Browser Library.

if your - Wait For Elements State ${VISIBLE} state=visible - does not throw an exception, Wait For is never called and once the test finishes, you get that error of unresolved promise.