I don’t think the lenders will agree to this, which is why this is usually done outside of escrow and is considered fraud. I had a seller give me credit in the past on home purchase, but the lender’s guidelines limited it to something like 3% of the sales price.
There have been too many recent defaults, where the buyer overpaid and received cash back, only yo walk away from the loan. The lenders, DAs and assorted lawyers are on to this scheme, so I would avoid it. Even if you are trying to do it the right way.