Animation with rotation around z-axis in Blender does not convert to y-axis in GLTF-export
**Describe the bug**
I have an object which has an animation with rotation around the z-axis and that scene is exported to GLTF, the scene will be converted to Y-up, but the animation appears not to. "Y-up" is enabled during export and the scene, except for the door, appear normally when exported. In fact, the door appears just fine as well, until the animation is started.

**To Reproduce**
Steps to reproduce the behavior:
1. Open the attached .blend-file
2. Play the animation for "Right.door"
3. Export to GLTF
4. Upload the .glb-file to https://gltf-viewer.donmccurdy.com/ and see the door animation being faulty.

**Expected behavior**
The door should animate as it does in Blender, instead of wrongly as shown in the gltf-viewer.

**.blend file/ .gltf**
https://we.tl/t-8hiGgS9rsY

**Version**
 - OS: Ubuntu 20.04 LTS, 64-bit X11
 - Blender Version: 2.91.2

diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py
index c3913367..55f4d35d 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py
@@ -56,7 +56,10 @@ def gather_animation_sampler(channels: typing.Tuple[bpy.types.FCurve],
                                                  bake_channel,
                                                  driver_obj,
                                                  export_settings)
-
+    if blender_object.parent is not None:
+        matrix_parent_inverse = blender_object.matrix_parent_inverse.copy().freeze()
+    else:
+        matrix_parent_inverse = mathutils.Matrix.Identity(4).freeze()
 
     sampler = gltf2_io.AnimationSampler(
         extensions=__gather_extensions(channels, blender_object_if_armature, export_settings, bake_bone, bake_channel),
@@ -64,7 +67,8 @@ def gather_animation_sampler(channels: typing.Tuple[bpy.types.FCurve],
         input=__gather_input(channels, blender_object_if_armature, non_keyed_values,
                              bake_bone, bake_channel, bake_range_start, bake_range_end, action_name, driver_obj, export_settings),
         interpolation=__gather_interpolation(channels, blender_object_if_armature, export_settings, bake_bone, bake_channel),
-        output=__gather_output(channels, blender_object.matrix_parent_inverse.copy().freeze(),
+        output=__gather_output(channels,
+                               matrix_parent_inverse,
                                blender_object_if_armature,
                                non_keyed_values,
                                bake_bone,
['addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py']