Is it safe to eat a cake with semi spoiled lemon rind?
Of course if an item is spoiled this means you should throw out anything that contains the spoiled item. However, based on your description, I have an alternative hypothesis. Brown discoloration in fruit does not mean the fruit is spoiled. Discoloration can be normal, especially if there was no unusual smells or changes in texture in the lemon. You said the lemon still appeared fresh on the outside.

The more likely scenario is that the bitterness is from the lemon rind itself. The white pith underneath the outer bright yellow layer of the lemon rind is very bitter. If you go too deep while zesting a lemon your dish can easily be ruined by nasty bitterness. Only scrape the outer yellow surface when zesting a lemon. This can be quite challenging and takes some practice before you start zesting like an expert.

Without a further description of the lemon, it is impossible to say whether it is spoiled or not (it very well could be), but even if it was I doubt the spoiled lemon is causing bitterness (it would probably cause a different but equally undesirable flavor).