'Why does the freezeWeights fucntion not work for me in MatLab?

I am following the mathswork tutorial for transfer learning on the GoogLenet, and when it comes to the freezeWeights function, it just doesn't work for me, and I am copying the function execution of the tutorial word for word here. It doesn't give me a proper error message either, just says

enter image description here

I have no clue why it isn't working. Am using a mac and MatLab version R2021b. Any ideas why it won't work?

Edit: Link to tutorial I am following - MatlabTransferLearning



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source