I think you're getting the deposit required on exchange and the deposit required by your mortgage lender confused.
When you put the offer in, the lender said they'd lend you eg. 100k. If the purchase price is 150k then you need to find the other 50k plus fees and disbursements. This is your "deposit" as the mortgage lender would see it.
On exchange of contracts, the contract will say you need to provide a deposit of 10% of the purchase price, so in the example above, that would be 15k. You can't use the HTB bonus for that, but you can use the money you have saved in the ISA towards it.
Your solicitor will apply for the bonus once they have the HTB ISA closing statement and first time buyer declaration from you. They apply through a HTB portal and the funds are usually released directly to the solicitors client account the day before completion.
So if purchase price is 150k
Mortgage is 100k
You are contributing 50k in total (forget about fees etc for this example) but know you are getting a 3k HTB bonus.
You transfer 15k to solicitors for the 10% deposit required on exchange of contracts. This can include the money in your ISA but not the bonus.
Contracts exchanged.
You transfer the rest of the money the solicitor needs from you for completion, which is 50k, less the 3k bonus you know is coming from HTB, less the 15k you have already paid on exchange, which comes to 32k
Solicitor applies for HTB bonus and gets the 3k into their account the day before completion.
So on completion the solicitor has the following in their client account:
Mortgage advance = 100k
Exchange deposit = 15k
Completion money from you = 32k
HTB bonus = 3k
Total = 150k which is the full purchase price of the house.
Hope that makes sense!