This is actually correct, what's "wrong" is for Duolingo to teach that 'mboga' by itself means vegetable. It's not totally wrong, but it is misleading. Mboga is actually the word to describe anything that you eat with ugali, it's more like a side dish. So while ugali is normally eaten alongside vegetables, that is not always the case.
If you don't know why you would have a word for food you eat with food, ugali is eaten by grabbing a piece with your (right) hand, then splitting it in two pieces, top and bottom, with your thumb. Then grabbing 'mboga' with the top piece and putting both in your mouth. After you finish eating the piece of ugali with mboga, you normally eat the bottom piece by itself.
"mboga za majani" means green vegetable, for example a carrot is a vegetable but not green vegetable so in swahili carrot will just be "mboga" not "mboga za majani"- i guess it doesn't fit into the "literal" meaning of majani which is leaves but "kijani" which is green as you would call it in English "green vegetable"