When cutscene Knuckles appears, the enemy palette is essentially replaced with the player palette. Usually, the enemy palette has three gray colors in the same place as the ones in the player palette, except the ones in the player palette are a bit brighter. Additionally, the player palette is black where the enemy palette is olive, so when Knuckles shows up, the shadow on the HUD's numbers becomes stronger, while the shadow on the lettering becomes lighter.
Angel Island Zone's enemy palette is maddening. There's a perfectly decent (if a bit too blue) dark gray right before the three-piece gradient, but they decided to put a light gray in the HUD shadow slot, creating this abomination:
Starting from Sky Sanctuary Zone, the game sort of stops respecting the placement of the grays and just lays them out whichever way it sees fit. The proper color is right there, but since they shifted the whole gradient over, we end up with a pitch black HUD shadow.