When you bought the shirt, you bought a single, personal license to display the Mario character. You didn't pay for a license that grants wider distribution, i.e. on a cake, or a poster, or as an image you can upload to somewhere on the internet. You didn't sign a contract when you bought the shirt, but I'm sure there is a tag on it that says the design is licensed by Nintendo and all reproductive rights are reserved by them, or something to that effect.
Your license of image of the Mario character can't be transferred to the supermarket to make the cake, because they are producing the cake and need their own license to use the Mario character in their own product(s).
In the UK, the usage of Mario on your cake is not Fair dealing (Wikipedia), where the use is "for the purposes of research or private study, where it is to allow for criticism or review, and where it is for the purpose of reporting current events." (In the U.S., it's similarly known as Fair Use | U.S. Copyright Office with different stipulations. See also International copyright treaties - (Wikipedia).)
Yes, it's very-by-the book, and I doubt anyone - including Nintendo - will care. But the supermarket, as a business entity, has to be very careful about any type of infringement in any of their products, and no doubt has been instructed by corporate lawyers to respect every instance of licensing and copyright and trademark and to not risk any instance of infringement, even if they lose a customer, as the cost of any infringement, if the market was sued, would probably be far higher than the loss of a few cake orders.
If you looked around at the bakery, there will be a flyer or signage at the bakery stating that they can't reproduce trademarked or copyrighted images, and there may be wordage on anything you sign to confirm an order for a cake that says you are responsible to have copyright permissions or a license for any imagery used on the cake.
And businesses that make prints of your own personal photos do have stipulations as to what they will reprint, concerning either the content of the photos or if you own the copyright to the photo itself. You will see the fine print at the photo shop when you drop off a digital files (or film negatives) for printing that you need copyright permission to reprint photos taken by others, etc.
But of course, like anything, there are exceptions; not all stores or employees or copyright holders are going to care or enforce their own copyright policies all the time.