Thanks Rich.
I did as you said, but the error persists. I also did "dmesg | grep video" and I can see that bcm2835-isp and bcm2835-codec is registered on multiple /dev/video<number> (which makes sense because the camera does work when snapping photos using CLI) then I checked which PID firefox has using "ps" and "fuser /dev/video<number>" and firefox does show up as a being connected to these video files.
I'm starting to doubt that it's a permission thing... but what else could it be?
I'm using:
sudo chown tc:staff /dev/media*
sudo chown tc:staff /dev/dma_heap/*
sudo chown -Rv tc:staff /dev/video*
And when firefox asks me which camera to pick it shows unicam (along with bcm2835-isp, etc) which is the same device picked when running "libcamera-jpeg -o ~/camera.jpg --width 640 --height 320 --nopreview".
EDIT: it's not related to firefox extensions either I think, because I've not installed any
and also tried running in -save-mode