An additional $40k down is big, but it doesn't move the debt to income ratio needle by much. You could with far less expense buy your rate down or pay off bills to qualify, so something else is at play.
Although all of the facts are not in, here's my guess on why you were asked to put more cash down:
Lenders have specific documentation requirements based on how their Automated Underwriting Systems (AUS) fire. At a Loan To Value of X a lender may need 2 months of bank statements. At a Loan To Value of Y, a lender may need 1 months bank statement, or a Verification Of Deposit.
If your contract was signed in February, and the application for full loan approval began shortly thereafter, you'd need to provide December and January bank statements. Assuming your family gift came in December, that's where the issue is.
If you need a loan approval to meet contingencies - super important so that you don't lose the home - agree to put the additional funds down. It's possible (although not certain....) that you can apply early March with another lender and supply January and February bank statements for the approval. Take a look at the end date of your January statement. From there you can guess where your February statement will be available.
As an FYI - Suggestions for ANY and ALL buyer reading this thread:
1) Read your statements. If you have any "non payroll" deposit of any kind greater than 5% of your monthly income, you have to source it. Example: lend a friend $1,000 then get it paid back? You have to source the funds because there will be a $1,000 mystery cash deposit into your account that will catch the eye of an Underwriter.
B) Do you have funds coming from accounts overseas or "family gifts"? For most lenders, you are now radioactive and the half life of such radioactivity is 70 days - the time it will take from the transfer of funds to the U.S. to the time your banking data will be accepted by most lenders. I know one lender who has told customers to just "wire the funds into escrow right before closing". If anything changes, or goes wrong for any number of reasons, do you really want to see your sale collapse at the zero hour when you could have moved funds months ago to avoid a calamity like this? Bring the funds early to the US, or transfer from family right away. In order to close with certainty, "hope that things will go well" is not a reliable strategy here.
III) I worked recently with a customer who had 15+ separate cash banking accounts. Some were brick and mortar banks. Others were on-line only. Others still were credit unions. That customer closed late. Why? The borrower signed closing documents, then began to wire to escrow. When $100k from an on-line bank is moved to a brick and mortar, the on-line bank took 3 days to transfer. The brick and mortar took 3 days to verify the funds were authentic. Mix into the calendar weekends or holidays and it could have taken a full 2 weeks to get funds to closing. This process was speeded up as a "rush" by the bank. It wasn't $100k in this example, but multiple $100k moves totaling $800k being accumulated. At that level fraud alerts begin to ring loudly so extra scrutiny occurs. The solution? Move cash into a centralized account early in the process, not at hour zero. It's OK to move from Chase to Wells or from TD Ameritrade to Chase, as documentation is relatively easy to get. It's the matter of rushing the process right at closing which can cause cascading delay issues. If needed, move often, but move early.
Hope your $40k problem gets worked out into a better solution than what's been presented by the lender you've been working with.
My .02c
SGIP