Yes, the attack was called "ice" but it wasn't actually ice...that's just the technique name. Gray specifically stated that he wasn't making ice and was making devil slaying instead. He just made the devil slaying magic "cold" in the same way he previously made his ice "hot."
Two notes about Viernes:
-Gray fought human form Viernes, not full Dragon form Viernes. You can complain about Viernes taking a lesser form but every Dragon God we've seen has fought using human or other weaker forms so it's consistent.
-Viernes' copy of Duke used Whiteout. Even then, Whiteout didn't make Duke immune to taking damage from magic. Viernes himaelf never used Duke's powers even when fighting amped Natsu, and the Duke copy only existed while Viernes was absent from the physical world. The only way this would be a retcon would be if Viernes previously used Dukes magic himself but didn't in this appearance, and that's not the case.
Duke was confirmed as an illusion created by Viernes, meaning every power Duke had was thanks to Viernes' power. Thus if duke has the power to steal magic then so does Viernes. Especially a version of him that is much stronger.
Also, even if it was devil slayer magic, Viernes already confirmed and shown that he could neutralize it through alchemy. It wasn't just Gray's Ice that Viernes was initially neutralizing, but his dark magic, aka demon slayer magic, too. Viernes out of his own mouth states and shows this in chapter 181. So even if he was making his devil slayer magic cold, Viernes was stated to be able to neutralize devil slayer magic. So, regardless of whether it was Ice or Dark magic, it was already confirmed the Viernes could neutralize it. People tend to conveniently overlook the part.
Add in Gray uses multiple devil slayer and dragon seal attacks prior,, and they have no effect on him, so how does that same attack hurt Viernes now was my point?
There are multiple retcons and contradictions that no one talks about from chapters 181 to 182.