Welcome to the forums and thanks for replying.
That phone is also known as the Galaxy S5, which was released in 2014. Being that old, no one is making fresh batteries for it anymore. If money is a concern, I would try buying a replacement, but keep in mind batteries decay with age, and any "new" battery is currently at risk of having the same issues now. Even a OEM battery is susceptible to it. So it may take buying several batteries to find one that's still half decent. The frustration factor alone may push you into replacing the phone entirely. If it were a sealed battery, I wouldn't even suggest it due to the much higher battery replacement costs.
The quick and dirty version of why I think it's the battery is age and what's called voltage drop. In any electrical system, putting a sudden load on it will cause the supply voltage to drop. You can even see this in your home if the lights dim when your air conditioner kicks on, so it's not something limited to just phones or batteries in general. A healthy battery won't sag very much, even when doing demanding tasks like gaming. As it ages and gets weaker, the sag becomes more pronounced, eventuality going lower than the bare minimum needed to keep the phone on. When this happens, it's like disconnecting the battery all together and it shuts off instantly. This normally starts happening at lower percentages, like 5-10% capacity left. As it gets worse, it'll happen higher, such as at your 50% cutoff.
For future reference, it's best to try keeping phones Li-ion batteries between 40-80%. Li-ion batteries are not deep cycle batteries, so keeping them above 75% long term, and dropping them below 40% accelerates their aging. They prefer a happy medium.
06-08-2019 09:31 AM