I think the boost/debuff from Rivalry is blocked by Substitute when the descriptions on Veekun and other places say nothing about the ability doing this. A Beautifly recently did 18% to my opposite gender Amoonguss, than broke my Substitute on the next turn. Here are some calcs that demonstrate this is impossible unless this was the case:
0 SpAtk Swarm Beautifly Bug Buzz vs. 228 HP/252 SpDef+ Amoonguss - 19.25-22.77% (Swarm Beautifly will never do 18% to Amoonguss unless it is running less than max IVs for some inexplicable reason, so the extra damage can't be due to it's HP dropping into Swarm range)
252 SpAtk Rivalry Beautifly Bug Buzz vs. 228 HP/252 SpDef+ Opposite Gender Amoonguss - 18.31%-21.83% (Rivalry Beautifly can do 18% damage, but not while also being able to do 25% damage; in fact it can't do 25%)
96 SpAtk Rivalry Beautifly Bug Buzz vs. 228 HP/252 SpDef+ No Gender Amoonguss - 21.35-25.35% (Rivalry Beautifly could do 25% damage if Rivalry isn't active, but not while also being able to do 18% damage; in fact, the damage calcs here should be the same as Swarm Beautifly and it would be impossible to do 18% with max IVs)
Here's a picture of this happening: