Hi there,
Do this problem only appear in all Excel files or a specific file?
Please check if you turn on the Share option in Excel, if yes please go to the Review tab- Unshare Workbook option.
Log in to the server hosting the file and go to Administrative Tools -> Share and Storage ManagementClick on the Manage Open Files... link on the rightSort by the column Open File and see if the file in question is actually locked open by anyone.
The below thread discusses the same issue and you can try out some troubleshooting steps from this and see if that helps you to sort the Issue.
https://social.technet.microsoft.com/Forums/en-US/15ad287c-1e2e-4d68-9706-f90b7842ec6f/excel-2016-not-lock-already-opened-file?forum=excel
https://answers.microsoft.com/en-us/msoffice/forum/all/file-locking-not-working/64832170-b659-4825-82e3-1f4b48380182
------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer–