How Can I Deal With

When I update Dynare to 5.1, the previous files cannot run out, and the following error will appear, meaning that the files in MEX are invalid. I am currently using 4.6.3. When I download a previous version, such as 4.4.3, the following error will also occur, unless I set the path to 4.6.3 that I am currently using. How to solve it?
PS: operation environment is macOS.

See