Yesterday I tried all the different kinds of URLs, and I think I tried the "old-school" version:
"https://facebook.domain.dev/site/index?id=123"
So this works now :)
But, the createUrl function still generates urls like in the original question.. but that's another problem...