Handwriting notes engages your spatial memory, which is incredibly powerful (see: the ancient method of loci/memory palace techniques)
There were times in college where I blanked on important information during an exam, but was able to recall it by visualizing the physical sheets I had written my notes on. I aced several infamously difficult classes like OChem and OChem 2 using that technique.
I’ve never found it possible to do that with typed notes.
I'm curious how many times you end up in the similar situations as an exam after you graduate from college.
I share your experience of remembering written notes while a student, but I also don't have any critical need to perfectly remember any of the notes I'm taking now so comparison points are scarce.
I still remember the code shape of methods, classes or screens I work the most on while programming, so I don't see it as bound to a specific medium. That's one reason why I use figjam or Miro type tools so much as well.
Visual and spacial memory are powerful for many of us, but the relation to handwriting and perfectly memorizing things isn't straightforward, and getting adapted tool will tremendously help IMHO.