AnimationPlayer returning null when played in _ready() function

Godot Version 4.5

Why is my AnimationPlayer returning null?

Im pretty new to Godot, but I’ve managed to get the fade in animation working in a different scene, as when that animation is played the player is taken to a different scene. However, I am trying to implement a fade out animation on the second scene to create a smooth fade to black and out animation. All I seemed to be getting with my code was an error saying something along the lines of the animation player (named Transition) was null. Now the scene runs but the animation does not play and after searching tons of posts I still have no clue why. Any help would be greatly appreciated, thanks in advance.

How are you accessing the AnimationPlayer in your code and what is your scene tree structure (before and after the transition)?