وَالسَّعِيدُ مَنْ سَعِدَ بِقَضَاءِ اللَّهِ تَعَالَى وَالشَّقِيُّ مَنْ شَقِيَ بِقَضَاءِ اللَّهِ تَعَالَى
The fortunate is the one made fortunate by Allah’s decree, and the wretched is the one made wretched by Allah’s decree.
The ultimate state of felicity or wretchedness accords with Allah’s knowledge and determination. Humans do not know with certainty their own or another's future ending, so an absolute final judgment cannot be drawn from outward deeds alone.