When trying to create or edit a Wikilink that consists of an anchor or contains an anchor, the anchor will be stripped. Instead it should be retained. The part before the # should also not be changed, it should remain page relative if it currently is.
I think this worked at some point with VE.
Example for what the resulting wikitext should look like (here done without VE as a workaround):