Maybe? But there are a lot of obstacles to this working
There are three sub-questions that you need to work in your favor here, in order for your escape to succeed:
- The shackles must not meld into your new form
- Your new form must be able to escape the shackles
- You must have cast Polymorph successfully in the first place
Let's deal with these concerns, one by one.
Do the Shackles meld into your polymorphed form?
Consider the last portion of text in the Polymorph spell's description:
The target’s gear melds into the new form. The creature can’t activate, use, wield, or otherwise benefit from any of its equipment.
Technically, the spell doesn't say what happens when you revert back to your usual form, but if you were intended to revert back not wearing any gear or equipment, it's very likely the spell would say so.
Now, it is debatable whether restraints constitute count as "your gear," since they certainly aren't beneficial to you (and it is debatable whether or not you own them). As such, there are three possibilities:
- They count as your gear, in which case they meld into you, and reappear when you drop concentration.
- They do not count as your gear, but they meld into you anyway.
- They do not count as your gear, and thus do not meld into you.
If your DM decides that either of the top two conditions are the way to go, then this tactic will not work. Keep in mind that, unlike wild shape transformations, melding into your new form is the only option given for equipment (there is no stated option for it falling to the ground, or remaining on your form). So a DM would be well within their rights to decide that equipment which is not your own also melds into your new form (i.e., taking the second option). And even if a DM decided to go with the third option, they could decide that the manacles stayed on you while transformed, and that you then remained manacled when you changed back.
But what if you got tiny?
Let's assume for a moment that the DM has decided that equipment that is not your own will not meld into your body. How does this help you if the equipment is then still on your new form?
There is a loophole here: what if you polymorphed yourself into a creature the manacles couldn't hold? The text of the Dimensional Shackles state (DMG, p. 165):
The shackles adjust to fit a creature of Small to Large size.
Thus, if you polymorphed yourself into a beast which was tiny sized, you could conceivably make the argument that the shackles are not your equipment, do not get merged into you, and thus fall to the ground.
There are two main impediments within this argument. First, there is not text within the Polymorph spell which specifies that equipment you are wearing can fall to the ground, so a DM would have to decide what happens in this circumstance. More importantly, most tiny beasts are very unintelligent (at best, you could be a cat with an intelligence of 3). And the Polymorph spell states:
The target’s game statistics, including mental ability scores, are replaced by the statistics of the chosen beast. It retains its alignment and personality. (PHB, p. 165)
Your new form may not be intelligent enough to remember that you need to drop concentation. As such, you may simply be grappled by a nearby enemy. At that point, it would not be difficult for two enemies Ready an action to place the shackles back on you (since they don't require attunement, any enemy could do this) immediately after their comrade attacks you.
Still this strategy remains conceivably vialbe so far, provided a DM has ruled in your favor on all the uncertainties. But there is one big obstacle remaining:
But... how did you cast the spell?
Keep two facts in mind: first, polymorph is a spell which requires material components "(a caterpillar cocoon)". Second, consider exactly how the shackles come to be on a creature in the first place (DMG, p. 165)
You can use an action to place these shackles on an incapacitated creature.
If you are placing the shackles on an incapacitated creature, it would be wise to also remove any arcane foci from them, as well as removing material components from their person. Even a sorcerer casting via Subtle Spell would still be unable to cast this spell in that circumstance, as Subtle Spell does not remove the requirements for material components.
So although there is a real possibility that polymorph could get these manacles off of a spellcaster, it's worth noting that deciding this would happen does require some interpretation on the DM's part in your favor, and is more importantly unlikely to come up since a caster restrained in this way is also likely lacking the required materials to cast this spell.
So although the strategy you listed is viable, I definitely wouldn't call it "easy." It requires a lot of things to work in your favor, both in the world of the game, and in the mind of the DM. Ultimately, if you have the ability to cast this spell, you might be better off trying another (such as Suggestion).