Looking for mathematical help!

I have a character that can shoot arrows. The initial speed is set, the gravity force is set. The arrow goes out from the character’s coordinates and through a set point on screen. I need to find the X and Y velocity of the arrow!

Screenshot 4

I thought that the formula I found works, and I tested it many times and didn’t find any flaws. But, as you can see on the screenshot, it isn’t working! (I just updated the formula and it seems to be more accurate, but it’s still not perfect)

My stream