Sometimes, if you are using resource pack that has transparent experience bar, it loses transparency completely.
Any transparent section of experience bar appears as pitch black.
How to replicate
1: Get any resource pack with transparent experience bar.
2: Get any items on hotbar. If there's an item that's not stacked and not damaged as well, it may cause experience bar to lose transparency.
If the hotbar is empty or all the items are stacked or damaged, experience bar regains transparency.