Sporadical Error on Login

Sometimes we get an error after submitting the credentials.

Our logs:

2020-08-04 09:00:03,797 DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-73) USERNAME: PathInfo: /realms/[REALMNAME]/login-actions/authenticate
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.resources.SessionCodeChecks] (default task-73) Will use client ‘[CLIENTNAME]’ in back-to-application link
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) {1} cookie found in the requests header
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) Couldnt find any cookies with name AUTH_SESSION_ID, trying AUTH_SESSION_ID_LEGACY
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) {1} cookie found in the requests header
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.managers.AuthenticationSessionManager] (default task-73) Not found AUTH_SESSION_ID cookie
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) {1} cookie found in the requests header
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) Couldnt find any cookies with name AUTH_SESSION_ID, trying AUTH_SESSION_ID_LEGACY
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) {1} cookie found in the requests header
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.managers.AuthenticationSessionManager] (default task-73) Not found AUTH_SESSION_ID cookie
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) {1} cookie found in the requests header
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) Couldnt find any cookies with name AUTH_SESSION_ID, trying AUTH_SESSION_ID_LEGACY
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.util.CookieHelper] (default task-73) {1} cookie found in the requests header
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.managers.AuthenticationSessionManager] (default task-73) Not found AUTH_SESSION_ID cookie
2020-08-04 09:00:03,797 DEBUG [org.keycloak.services.resources.SessionCodeChecks] (default task-73) Authentication session not found. Trying to restart from cookie.
2020-08-04 09:00:03,797 DEBUG [org.keycloak.protocol.RestartLoginCookie] (default task-73) KC_RESTART cookie doesn’t exist
2020-08-04 09:00:03,797 WARN [org.keycloak.events] (default task-73) type=LOGIN_ERROR, realmId=[REALMNAME], clientId=null, userId=null, ipAddress=[SOMEIPADDRESS], error=invalid_code

We tried with an old KC 7.0.0 and KC 10.0.2 and different browsers. We can see in the browser that there’s no KC_RESTART cookie.
We have keycloak behind a loadbalancer and a reverse proxy.

Any idea what’s wrong?

Is there a way to show the login form again instead of the error message?

Thanks for help