YABU.
I am firmly with her (not you) on this one. And I speak as someone who bought & transported some expensive Swiss cheeses for two lots of ppl we knew (living in the Middle East) and was given BOTH lots back within a day or 2 when they had decided (after consultation) that they probably shouldnt eat it ... as maybe it was not halal? (Nb I had just thought "halal" applied to meat products.)
I was initially a bit taken aback/surprised that the gifts had been solemnly returned with great apologies. But later on I was impressed by their honesty/good intentions.
They knew I loved this cheese and had taken trouble to buy/carry it from Switz for them. They couldnt/wouldn't eat it, but they appreciated the thought, so they returned it to me as they knew I would enjoy it. (And also, like this, I knew not to bring the same/wrong thing next time?)
Now you know not to bring cake to that house again ... as she said it won't get eaten. But you didnt know & you showed yourself to be generous, (in bringing a gift), so that's fine all round that you got it back?
Would you really have prefered that she had put the cake directly into the bin? Or had to spend time trying to re-home a cake b4 it goes off, which is an enormous burden to her, so really not a welcome gift at all?
And finally, haven't you heard about trying to reduce food waste? Apparently we all (on average) throw away about 25% of what we buy? (Not me though.) So be happy the cake will get eaten now.
Throwing away good food is a sin. So eat the cake please and just don't buy cake as a gift again? (Nb Some ppl are diabetic/gluten intolerant or just trying not to eat sugar/empty calories.)
She wasnt being rude IMO. She just wanted someone to enjoy the cake.