The theory in your post is spot on, the baker should appeal.
It is an offence to discriminate against an individual but that never happened in this case.... The gay fella had bought other stuff before and even since the cake in question
The baker had no idea the orderer was gay. He refused...