The spiky sea urchins don’t have anything to do with the bananas.
The spiky sea urchins = unlocking the treasure piece. As posted in the links above, there are sea urchins throughout the map which correspond to a clue. In the room with the treasure, you match the correct color urchin with the clue and the treasure unlocks.
The bananas are needed to feed the animals once you are in the palace. They’re just lying on a table for Diggy to pick up. Once you’ve done that, you have to move the numbered stones to the correct valve to turn the wheel. Then the food automatically appears in the animals’ pens.