I recently hit the Lighting Build Failed issue on a M1 Mac. I was using UE5.03. However I was also running UE4.27 on the same machine to compare the project in the different engine versions.
With this setup UE5.03 fails to build the lighting. Both engine versions need to be quit and then the UE5.03 version relaunched and then the lighting builds OK.
So I thought I would post this as I noticed others had the lighting build fail issue and this was my problem / solution. Hope this make sense.