makes sense...
but lets take it a little bit more to the extreme.
how about this case:
person A ruins person B's life. lets say...rape or killing a relative.
afterwards person A repent...he sincerely repents...but person B's life is so ruined that he wont forgive...his/hers only wish is to see person A burn in Hell.
what happens then?
İf Allah would forgive person A just like that...wouldn't that be injustice towards person B?
If a person has done another a great wrong as in your example then a Muslim who repents will know that they need to compensate or obtain forgiveness from victim/victims family so it's only natural he'd try his best to do that
If a person has tried their best* to get forgiveness from victim... then in this case if the victim or his family still does not forgive, yet Allah could forgive so he still can hope for jannah
those who sinned and then they've repented and turned over a new leaf, even if they've died before even they can say sorry to victim and his family, Allah will forgive because if that person lived longer he naturally would have tried to make it up to victim even by way of praying for victims salvation or begging Allah to compensate him
A hadith says a Person murdered 99 people, repented and died just shortly after, the Angel of punishment and Angel of peace both came to take his soul. Angels started arguing who should take him. Long story short, Allah ordered Angel of mercy to take him to heaven:
https://youtu.be/hiFKNwICS8U
A hadith says, NO MATTER WHAT a person has done, if he repents to Allah without associating any partners to him, Allah forgive him of ALL his sins
Hadith No: 42
Narrated/Authority of Anas
who said: I heard the messenger of Allah say: Allah the Almighty has said: "O son of Adam, so long as you call upon Me and ask of Me, I shall forgive you for what you have done, and I shall not mind. O son of Adam, were your sins to reach the clouds of the sky and were you then to ask forgiveness of Me, I would forgive you. O son of Adam, were you to come to Me with sins nearly as great as the earth and were you then to face Me, ascribing no partner to Me, I would bring you forgiveness nearly as great as its." related by Al-Tirmithi, who said that it was a good and sound Hadith.
At the least a Muslim can beg Allah to compensate those whom he wronged and Allah the most merciful and bountiful can do just that, so this is why a sincere repentance gets all sins forgiven and stops all the jariya sins as a Muslim who's in no position to do anything else will at least do that
Or if a person begs Allah for forgiveness, he is asking All his sins to be forgiven, even those of wronging others, so Allah can forgive and take it upon himself to compensate the repenters victims, so there is multiple reasons and ways Allah could set things right this is why we should trust that all that's required for complete forgiveness and a stop to all sins is the repentance
* or even if he falls short of trying his best, as us humans are weak and Allah takes mercy on us as long as we're trying to worship Him in our hodge podge way.