In order for the script to work all involved mesh and armature objects need to have rotation of (0,0,0) and scale of (1,1,1). In addition to that the unit scale before starting needs to be set to 0.01 or you’ll get issues in unreal engine later down the line.
You are probably getting size problems because you didn’t not apply rotation and scale to the metarig after resizing it like shown in the video tutorials.