However, in both cases ConfD fail to start with the error message "Internal error: Startup failed; probably due to incorrect installation" and the error code Daemon died status=19 after loading d.fxs.
It looks like a bug, either in the yang compiler or in the ConfD daemon.
There are many more changes needed for the compilation to succeed, of course - it sure saves time if the actual YANG modules are provided, rather than just an “outline”.
I can’t reproduce this - starting as well as exercising the leafrefs works fine for me:
confd# config
Entering configuration mode terminal
confd(config)# A B name foo
confd(config)# A C name bar
confd(config)# A D d1 foo d2 bar
confd(config)# commit
Commit complete.
confd(config)#
(Completion works as expected on the “A D …” line.)