Robot Inventor Bluetooth not working
Maybe this project legoBTLE4pi could help you.
It connects a Raspberry PI via Bluetooth to a Lego Powered Up Brick and does all the funny stuff.
The project is ongoing (nice TUI etc) but everything works.