The version hash of Guix I tried this on was `26f6bd0403ed20c1d26eca9d4f28a0da519a56ac'.
I used the example JSON file for the `hello' package provided in
"(guix)Invoking guix import". Then, based on the given example of glib, I tried
running `guix import json' with `glib', `glib:bin', `glib:doc', `glib:out'
separately appended to the `native-inputs' array of `hello.json', in order. It
produced an appropriate SXML structure in the `native-inputs` field each time:
("glib" (@ (gnu packages glib) glib-with-documentation))
for standalone `glib' and
("glib" (@ (gnu packages glib) glib-with-documentation) "bin")
for the rest, which appears to fit the package definition syntax.
When I tried with `glib:foo', where `foo' is an erroneous output, it yielded the
guix import: error: package `firstname.lastname@example.org' lacks output `foo'.
So, it seems like this bug was fixed somewhere along the line.