How did you solve this? I have two issues, one identical to yours and another problem, whereby I need to run libcamera-hello (or any other libcamera command) before running the boilerplate for it to work correctly (I believe something is getting setup which I am missing in boilerplate code, then defaults to that for the following runs), both problems I get "VIDIOC_STREAMON: error 22, Invalid argument", I assume these issues are related. I am on exactly the same hardware and Bookworm.