Issue with all vert coords in vg summing to zero.
Made a quick demo to have a squiz,
Using 2.91 ran into this issue
Default Cube set up to drop on plane using physics. An all vertex group "Group" is added, and two constraints, as demonstrated with code above.
All constraints use default values unless otherwise stated.
For copy ...
In Blender 2.9+ there is an option for Auto Keyframing plane track corners.
If you press N while in the tracking scene and open the Track tab, there is a dropdown for the Plane Track which allows you to set Auto Keyframes for plane track corners.
You can make manual adjustments without having to export the trackers to empties and hook them.