>When I tell the recruiter ...
You are anyway talking to the "wrong" people.
A recruiter is generally an external consultant that has nothing to do with the actual company, he/she is tasked to find candidates for a role (and nothing else, and they are paid for providing these candidates only).
And they won't give you a contact to the company, let alone to the people inside the company that can overrule a taken decision "let's hire someone to do this" with an alternative.
If you manage to get to know the company they are recruiting for AND you manage to speak to its CTO (or whomever takes this kind of decisions) then you might have a chance to propose the alternative of just buying the code.