This question already has an answer here:
Bug introduced in 9.0 and fixed in 11.3
Does anybody has an idea what is wrong with adding edge to an empty graph created by my custom function?
Note that the following works:
as well as the call with "graph-as-picture":