Spoke too soon, animation issue actually wasn't my code, the rotation and scaling just aren't applied to the metarig in the .blend file. Another easy fix: select the metarig, CTRL + A > Apply > All transforms, export a new GLTF.