It sounds like you had a request for both construction and permanent financing. You originated the construction loan (exempt from HMDA because it's temporary financing) and provide a LE for the permanent financing. You say "The construction loan was taken out by a permanent mortgage in the secondary market loan . . ." This permanent loan is HMDA reportable either by your institution or by the investor - depending on who made the credit decision.
I understand the in-house loan was replaced by the 2nd market loan. I don't see this as a withdrawal but rather a different way to fund the applicant's request. I wouldn't report this separately as the 2nd market loan is being reported.