In the listing_contact_form.php, you can set the subject of the email sent through the contact form.
Line 13:
$subject = “Listing #”.$ListingDetails->listing_id.” Inquiry (“.date(“m/d/y”).”)”;
You could attach your custom field in there, or even just use the listing ID as the reference number. Then you wouldn’t have any problem..?