Why that far? It's at least twice further from either beginning or destination than those are apart themselves.
If it got hit over Makhachkala it’s closer to Aktau - just over the Caspian. Maybe it’s easier to land there with busted controls too
Seems like the plane was barely controllable. That may have just been the direction they were able to maintain.
If the pilots were aware that they had been hit by anti-aircraft defenses, and that they were in at least partial control of the aircraft, they might have concluded they were better off getting as far away as possible, just in case the AA operators try again.
So it crashed into the sea leaving no evidence or live witnesses.