The buffs arent removed once you enter combat. If you change specs yes, if you change gear or change trinkets _before_ you use the abilitys yes. Procc trinkets and rings however, does not get removed. Any One Use effect is removed but not proccs, hence the fruit basket-exploit that let you pre procc trinkets + 715 ring then change and keep the bonuses.
Having say 24 sec of 96% increased attackspeed over having 18 sec of 67% is a significant damage increase at pull, due to how cooldown stacking works.
From https://www.warcraftlogs.com/help/ranks/
As you can see.Ranks will be removed when players use in-game exploits that include any buffs that should not be possible given the gear/talents/specs that players are locked into once in combat. In other words, a rank will always be considered invalid if any lingering bonuses from gear, talents or specs are used by a player once in combat. Gear swapping for unintended bonuses is always going to be considered an exploit by this site.