If the dots on the ICs are in the same orientation on the the PCB, I suspect that the correct axis reassignment is this one:
fusion.MadgwickUpdate(gx, gy, gz, ax, ay, az, mx, -my, -mz, deltat);
The rate gyro measurements must be scaled to radians/second.