No, there is typically no fee for prospective borrowers to lock in their mortgage interest rate anytime prior to closing. If your rate lock expires, there’s typically also no fee to get a new rate lock at the current market interest rate.
In fact, the only time most lenders will charge a rate lock fee is if rates go down after you’ve locked your rate, and you wish to re-lock at a lower rate. This is called re-pricing your loan and will typically come with a fee.