Which microbit extension are you using?
Probably it is much better to send commands via UART, interpret these on your microbit and set the io-pins using makecode on your microbit.
See here: The Internet of Things: Data Acquisition and Analysis for a tutorial.
Of course you are using a bluetooth extension, but my question was, which one.
Actually it does not matter because you cannot address the io-pins this way, because all microbit extensions are flawed. You can only successfully use UART, read my previous post again. try the tutorials I pointed to, and then try your IOpins again.
Maybe I should have givne a bit more explanation. I have a tutorial about communicating with a microbit:
And the link to the internet of things tutorial I gave earlier (https://appinventor.mit.edu/explore/ai2/IoT_unit) has a more gentle explanation.
Except for the BLE extension mentioned in the Internet of things tutorial, you should use this one edu.mit.appinventor.ble-20230223-beta.aix (200.0 KB) mentioned in my tutorial, to get the proper Android permissions.
At this moment you cannot address the IO-pins of the microbit directly from App Inventor, as I said. So, what you should do instead is send a command to the microbit via the serial interface UART, the microbit recieves this command and activates the IO-pins, using MakeCode. All explained very well in the IOT tutorials.
The last example in these tutorials is about watering plants, I think also do via the IO pins, so that should help you.