YAML to JSON reads one document. JSON to YAML requires legal JSON, then prints a YAML document. Comments in YAML are not kept, because JSON has nowhere to put them.
Custom tags and enormous alias graphs are out of scope. If the text uses anchors heavily, simplify it before converting. The result is data, not a promise that a particular application will accept the keys.