This is due to the path length limitations that exist on the Windows operating system. The support packages, by default, get installed in the location provided by the following command:
>> matlabshared.supportpkg.getSupportPackageRoot
Try changing this default location to a path that is shorter in character length using the command mentioned in this page.
For example, if the default location is 'C:\ProgramData\MATLAB\SupportPackages\R2024a', change it to 'C:\ProgramData\MATLAB\SupportPackages\24a', restart matlab, reinstall the Simulink Support Package for Arduino Hardware and rebuild the model.