System.security.switchUser crashes

My main issue is the fact that the system.security.switchUser(“username”, “password”)
causes the client to crash.
Below is my timed script, but when the user switches I see the application freeze and get a java se binary is not responding fault.
I can run the application in staging mode in the designer and it works fine. Any help on this greatly appreciated.

#check the user that is logged in and switch user to operator after timer expired

name = system.security.getUsername()
#default user name and password
username = “operator”
password = “100”
valid = system.security.validateUser(username,password)

#check system activity
if system.util.getInactivitySeconds() > 300 and name !=“operator”:
if valid:
system.security.switchUser(username,password)
else:
system.gui.errorBox(“incorect user profile”)

Did you get a solution to this problem yet? We are having the same issue (java 1.8.60, Ign 7.7.3). Any help here is appreciated. Also note that this java issue is only on Ignition server, not on any of the clients, but the client computers are older and running 32bit java, too.