Why cant I hide some frames via an addon?

I have a basic addon that I’ve been adding to for years that is full of cvars and default ui tweaks. Mostly just hiding, enabling clickthrough, repositioning, and resizing various frames.

I’ve found a few different frames now that cannot be hidden with either SetAlpha(0) or Hide. However, these frames can be hidden in game with /run. Why is this a thing? I’ve been able to hide / customize the vast majority of frames without issue.

The frames I’m having trouble with are PvPObjectiveBannerFrame (one of the battleground popups) and CompactRaidFrame1RoleIcon + CompactRaidFrame1Name (role icons + player names in the default raid frames).

Hard to tell without the code but best guess is that you are doing the hiding etc. when addons are initialy loaded while your character is logging into the world.

The PvPObjectiveBannerFrame is part ot the Blizzard_PVPUI addon which is marked as Load-On-Demand (LOD) meaning it doesn’t load when you’re logging in but when the game (or you) does something to load it. The frame not being available (at login) to Hide(), would cause an error in your addon that would stop executing the rest of the code (possibly including your CRF items).