It depends on the use of the money, and whether or not the loan was perfected, and whether or not the terms of the loan are commercially reasonable AND if you have discriminated against other creditors to favor your relative in the repayment of the loan. It is not illegal per se, but the Trustee will examine the loan and your repayment history to make sure that assets of the company where not diverted to favor your insider relative.
REQUEST: Please give this answer a "thumbs up"(below) if you find it valuable.
Disclaimer: This answer does not constitute legal advice. I am admitted in the States of New York, New Jersey and Massachusetts only and make no attempt to opine on matters of law that are not relevant to those three States. This advice is based on general principles of law that may or may not relate to your specific situation. Facts and laws change and these possible changes will affect the advice provided here. Consult an attorney in your locale before you act on any of this advice. You should not rely on this advice alone and nothing in these communications creates an attorney client relationship. The opinions expressed herein are those of the author only and the fact that he has worked as an Assistant District Attorney; State Supreme Court Clerk; Special Assistant United States Attorney (Hawaii); Assistant Cornell University Counsel or Judge Advocate, United States Marine Corps should not be relied upon to assume that these statements reflect the policy of these organizations.
It is an issue that your Bankruptcy Trustee will want to look into. There have been a number of cases over the years where people have tried to "outsmart" the bankruptcy system by selling assets for below their value or even giving property away to family members or friends to avoid having to let the creditors receive their rightful share of property that should be paid in Bankruptcy.
If the contract you have with your second cousin is no better & no worse than a contract you could have made with a total stranger, it probably will hold up. If it is a sweetheart type of deal, expect some problems. In most cases, your attorney can resolve these problems, if you fully cooperate.