UNOs - Master-Slave and HMC6352 dig compass all three over I2C

Should the GND of the compass be connected to Arduino's GND in order to work as a slave device, just like with the slave Arduino? Cause currently I have it on the GND of the circuit.

Sure, the grounds of connected devices have always to be connected, otherwise they have no common reference where signal levels are related to.