Just a personal experience, but the enforcement of this practise at my school had a real detrimental effect on my learning.
I have very bad vision which wasn't picked up for various reasons, so learning to write did not go smoothly (my handwriting is and always has been barely legible). So being forced to write out everything I learned by hand was a real bottleneck for me.
Things went a lot better after I discovered touch typing, and nowadays I learn best via keyboard shortcuts and typed commands.
I have studied giving students typing practice, even wrote a paper on it[1]. Long story short, yes they are beneficial to most students. However, your situation is something I noted in my closing remarks - specifically that not all lower level practice will be beneficial to all students. In that case, to get the same learning experience from the activity, you should have been given a comparable lower level practice activity, like fill in the blank, Parsons Problems, or something else completely.
The idea of "writing it out" is to give the student familiarity without higher level "figuring it out on their own". I also teach martial arts, and so copying solution steps, or drilling, involves showing students how to do a technique and then having them do it. Both worlds are attempting to build muscle memory so if the instructor says to "do a tenkan" or "write a for loop", you have enough exposure to that concept to do it without thought.
I have very bad vision which wasn't picked up for various reasons, so learning to write did not go smoothly (my handwriting is and always has been barely legible). So being forced to write out everything I learned by hand was a real bottleneck for me.
Things went a lot better after I discovered touch typing, and nowadays I learn best via keyboard shortcuts and typed commands.