My best guess is that you were tightening your leg muscles due to the "stress" of having the biopsy. I've not heard of liver biopsy actually causing leg pain. Hope you feel better soon.
I've had 3 liver biopsies in 10 years and only once do I remember having leg pain afterwards. It was when I took a combo vaccine against Hep A and B right after my bx and before leaving the clinic to go home. I believe I had a reaction to the vaccine, and for that reason chose to not complete the series. The pain that I had was more of a nerve and bone pain than muscle pain, and my shin was tender to touch.
Which muscles hurt? Thighs, calves, all of these? Are you having cramps in the muscles? Drinking enough water? There can be so many reasons for pain, which makes it hard to answer your question of "why?" But I thought it might help if I just shared my own experience. Maybe someone else will chime in.
BTW, welcome to the group! Looks like you're new here, this is an awesome support for all of us, glad you found it!