This spawned function right here waits for a marker to play an animation. But the animation whose marker it is waiting for might stop before it reaches it. Now, i have tested by adding a print function before the :Play() and somehow it is ending the function even if it doesnt reach the marker due to the animation being stopped.
Now, for clarification, the script is still doing its desired function, playing the animation when i do let it reach the marker.