See if the TV supports DLNA by any chance, Jellyfin does, so all you’d need would be a DLNA controller app on your phone to make one cast to the other.
Alternatively, there’s a self-hosted app called BubbleUPnP Server that can DLNA-enable (some) things without native support. I know for a fact it can do it for Google devices, maybe it can do it for Samsung too.