If the Case is already in Closed status and if you have any processes to update the Milestone Completion Date, you will run into this error.
Update the CaseMilestone before the case saves as closed as the milestone must already be closed when the case is closed. Use a before update trigger on your case, and make sure that you update your completion date prior to closing the case. You can use System.now() for picking the time.
SOQL to update CompletionDate:
SELECT Id, CompletionDate FROM CaseMilestone WHERE CaseId = ‘<Case Id>’