Fish don’t get bored of it IME, you have to remember in the wild they’ll take any piece of food they can to survive. Yes a varied diet is best but it’s not needed. If a fish isn’t eating a certain food, that’s not boredom and most likely a disease or hunger strike.
The wild is a eat or die situation, fish will eat whatever piece of food they can find, wether that’s phytoplankton, small inverts (Copepods, Amphipods ect), algae, ect. They will take it, sometimes you will find some fish that are strictly herbivorous or strictly carnivorous but if you looked closely at their behaviour you may find some that take algae if they’ve ran out of one food.
Captivity is the opposite, it’s a get fed till you die situation. But fish aren’t picky, the times they often go off of food is during hunger strikes or parasites/disease can sometimes occur to a fish not eating. Or you could have an extremely picky fish that doesn’t adapt well to captivity and won’t eat a captive diet such as Acanthurus achilles, Acanthurus trigostegus, Zanclus cornulatus, Chelmon rostratus, Pygoplites diacanthus, Halichoeres iridis, Anampses spp, Macropharyngodon spp, ect.