HP-UX ssh X11 forwarding not working for certain applications

I had a strange issue with hp-ux x11 forwarding over ssh. xclock, xterm ran fine but hpterm and some other x11 programs didn’t start, claiming error:

X11 connection rejected because of wrong authentication.

after some searching I found following fixed the issue:

X11UseLocalhost no
(must be set to no, default is yes)