Garchomp is beside
Glimmora and you want to use EarthquakeGround. Earthquake includes adjacent allies, so Garchomp’s command cannot be considered on its own.
This Glimmora has Spiky ShieldGrass. With successful protection and no bypass or interference, it can avoid that partner hit, at the cost of not attacking. An opposing Protect or immune switch-in can still spoil Earthquake’s offensive value.
Choosing Power Gem instead does not make Glimmora immune to Earthquake. Even if Power Gem happens first, Glimmora can still take the partner hit; full damage conditions are needed to judge survival.
Replacing it with this team’s Whimsicott changes the available plan. That set lacks Protect, and Grass resistance is not immunity or proof of survival. Recheck moves, HP and friendly fire. Other spread moves have different targets, so do not assume all of them hit allies.