Not familiar with the Sparky2 as I've never used one, but FWIW, the functions you are trying to implement do work on the other targets I've used.
1)Regarding the internal mag, it should be the selected default. But the fact the your board is initializing to north indicates to me that the mag is not being read correctly. What does the magnetometer object read? Are all the values 0, or does the object seem to be getting sensor updates? Also verify that the internal mag is indeed selected.
2)What are the mag calibration results for the internal mag?
3)Regarding the external mag, has the flexport function been set to I2C? Also verify that external magnetometer is selected, and ExtMagPort is set to FlexiPort. I see there is also an option for AuxI2C, but I don't know where that connection on Sparky2 would be.
I do have one gps/ext mag unit that if plugged into my FC, will cause an I2C failure on boot, if it's not powered up. But if it's powered, it initializes and works fine. There's something funny on the I2C lines of that device. I should also mention that this particular device has an HMC5983 mag. The other units have HMC5883, and don't exhibit this issue. Not sure if any of this is relevant to your issues though.
Beyond that, I'm not sure where else to poke yet. I'm interested in seeing what the values are of your magnetometer x, y, and z objects are, both for the internal mag selection and external mag selection, and the internal mag cal values.