Source: Lost Laboratory of Kwalish

Weapon (any sword), very rare (requires attunement)

When you attack a creature with this magic weapon and roll a 20 on the attack roll, the creature must make a DC 15 Wisdom saving throw in addition to suffering the attack’s normal effects. On a failed save, the creature also suffers the effects of a Polymorph spell. Roll a d20 and consult the following table to determine the form the target creature is transformed into.

d20 New Form
1 Tyrannosaurus
2 Giant ape
3 Elephant
4 Giant scorpion
5 Rhinoceros
6 Polar bear
7 Giant toad
8 Giant eagle
9 Black bear
10 Crocodile
11 Wolf
12 Horse
13 Ox
14 Giant frog
15 Poisonous snake
16 Hawk
17 Octopus
18 Cat
19 Rat
20 Rabbit

A creature is immune to this effect if it is immune to damage of the weapon’s type, is a shapechanger, or has legendary actions.

Curse. This weapon is cursed, and becoming attuned to it extends the curse to you. Until the curse is broken with a Remove Curse spell or similar magic, you are unwilling to part with the weapon. Whenever you attack a creature with this weapon and roll a 1 on the attack roll, you suffer the effect of a Polymorph spell for 1 hour, rolling on the table to determine your new form.