The next most likely problem is the pin mapping. The board appears to have two qwiic connectors that are JST SH/SR connectors but the port and pin mapping is definitely not compatible with the regulard JST-GH connectors that most autopilots use.
This wiring might work but it’s actually slightly incorrect because I suspect the SpeedBee’s I2C logic levels are 3.3V and this will make them 4V or maybe 4.5V. It will probably work but it’s not quite correct. A better solution would be to provide 3.3V into VIN but I don’t immediately see a 3.3V output from the SpeedyBeeF405AIO.
I installed this firmware and checked mission planner but still no success.
Also as for the pinout I have the pinout of SDA and SCL exactly as given in the pinout by you.
But for the pinout of power I am using the “A” “B” pins given in the pinout for GND and 5V respectively.
Hopefully that is not a problem.
And yes this is my first time using a compass.
I actually have tried using ardupilot copter 4.6.3 with the custom firmware and also with stock but to no avail.