I checked it, unfortunately in our system all internet users are created as communication user in SAP, and this FM is for switching to dialog user only. For communication user I got logon data error, for dialog user I don't get an error.
I believe the solution will be to embed an iFrame in the LoginWD, inside that iFrame a BSP with javascript, which will call the LoginWD url in the _TOP window, meaning it that the LoginWD will occupy the whole area. It's ugly, but I have no other option.
Thanks for your help.