I think what the unpack_simple_*() currently do are ok -- return false with an error message as long as it's not a resource.

EXPAND_CONSTRAINT_IDREF are invoked in unpack_*_set(), where all the templates/tags are supposed to have been expanded. It seems to also make sense to just return false with an error message as long as it's not a resource, no?