I've used the search and couldn't easily find any topic related to this.
This is just a feature request for reference fields to be able to use custom fields.
maybe something like
If the custom field doesn't exist then it would simply copy and paste nothing and or a sting like:
Reference found no Custom Field: name_of_field
Or rather you can always keep it as it is now where it would just paste the reference code as it does now when the reference doesn't work.