Can't reverse animation the second time and animation doesn't replicate to the server

So i was trying to play the animation by pressing E on the keyboard and reverse it when pressing R on the keyboard. The animation can play but when i tried to play and reverse it the first time, it works perfectly. However, in the second time, i also tried to play and reverse it the second time, it stops working and it pause at that position.

> Note: animation variable in the script plays two frames(play once), the first frame and the last frame of the animation, the poseanim variable plays and loops the last frame of the animation variable. I do this because i want it to stop at a specific position after finishing the animation.

> Also, i noticed that when i tested with the roblox studio test tool(idk how to call it but it is the tab in roblox studio that is named TEST) it’s weird when viewed on the player that sees the animation and the player who plays the animation.

Here is the proof:


As you can see in the video, the screen on the other player that sees the animation see it like a loop animation.
Here is the code:
client:

repeat
	wait()
until game:IsLoaded()
local player = game.Players.LocalPlayer

local animation = script.Animation
repeat 
	wait()
until player.Character
local contextactionservice = game:GetService("ContextActionService")
local humanoid = player.Character:WaitForChild("Humanoid")
local FPS =  humanoid:LoadAnimation(animation)
local poseanim = humanoid:LoadAnimation(script.poseanim)
local runservice = game:GetService("RunService")
local tool
local function binding(name,inputstate,inputobject)
	if name =="pose" and inputstate == Enum.UserInputState.Begin then
		print("Play")
		FPS:Play()
		FPS.KeyframeReached:Connect(function(keyframe)
			if keyframe == "Frame2" then
				tool = runservice.RenderStepped:Connect(function(dt)
					poseanim:Play()
				end)
			end
		end)
	elseif name == "reverse"and inputstate == Enum.UserInputState.Begin then
		tool:Disconnect()
		if poseanim.IsPlaying then
			poseanim:AdjustSpeed(-1)
			FPS:AdjustSpeed(-1)
			poseanim.TimePosition = 0
			FPS.TimePosition = 0
			poseanim:Stop()
			FPS:Stop()
		end
	end	
	end
contextactionservice:BindAction("pose",binding,true,Enum.KeyCode.E)
contextactionservice:BindAction("reverse",binding,true,Enum.KeyCode.R)

The animation stuff makes me so frustrated these days and i’ve been debugging for 2 days so if anyone can help, pls help :))

> Edit: the first problem was fixed,the animation successfully reversed but it still doesn’t replicate to the server