I don't know if you have a back-up solution which does a back-up of your Microsoft 365 environment? (Exchange Online/Teams/Sharepoint/OneDrive) That would be the beter solution in my opinion, other companies use the option when you delete a user in the 365 admin center to give another user access to the files (It prompts you when deleting a user and starts a wizard) The user user can access the files and copy it to his/her OneDrive)
Another thing is.. Is your company allowed to retain left employee's data and for how long? Some countries have regulations for that.