The grey should be a switch line, gets voltage to switch the fan on from the light switch and then it can run when the light is off by the other supply (brown and black in this case).
You need to check that it hasn't been wired as an earth but chances are grey is usually switch.
Here's some rather bad photo's