The thing about magic in Harry Potter is that there always seem to be a countermagic. Like the wards on Hogwarts that prevent... erm... what was the term again? For teleporting?
Likewise, although not explicitly stated, it should be safe to assume that there exists magic that can divine/dispel polymorphed people.
And besides... Polyjuice is suppose to be restricted magic. They did it illegally.
Remember the self-defense classes? Well... at least the theory, not what happened.
Heck. Even Harry's mother's love was a ward against what was otherwise, an almost unstoppable curse.
One of the reasons why it is banned. It being too hard to protect against.