I do something similar, but only for bugs that were especially tricky. I don't do it as I am debugging, but if the bug qualifies, I'll write down the steps I took debugging it, as well as the reason for it, the fix, and (most importantly) lessons learned. I've done this for close to 20 years now, and I believe it's helped me internalize a lot of lessons on how to code, test and debug.
https://henrikwarne.com/2016/06/16/18-lessons-from-13-years-...