Lego Robot

I had a feeling it was the new python virtual environment that was messing you up.
Virtual Environments, Libgpiod, gpiodevice and the current mess I’m making of our Python libraries - Support - Pimoroni Buccaneers

If it’s not a Pi 5, you could run Pi OS Legacy. No virtual environment to have to contend with.