When applying loot tables to containers, the contents of barrels cannot be modified.
- Apply a /data merge command to a barrel to give it a loot table
→ Contents will not be altered
- Try using the /setblock command
→ The barrel will not have the loot table contents
All commands used worked properly on chests and shulker boxes but not barrels.