(Here’s the rewrite we promised.)
Petach 82 touches upon another vital issue and begins with the statement that the Tikkun granted each individual soul is a result of how the conjunction of MaH and BaN is arranged in his own instance.
Ramchal explains that in Klallim Rishonim (34) where he says that it’s important to know that “there are things … that are rectified thanks to an abundance of light (i.e., Divine generosity) and by (Divine) benevolence (toward one person or another), and there are others that … are rectified by (one suffering) tribulations, poverty, and want that have nothing to do with (one’s) merits or misconduct, but rather on the makeup of the created world alone” and on “the (makeup of the) conjunction of MaH and BaN” .
That’s to say that some things happen simply because the makeup of creation requires it to happen that way, and because it falls under the rubric of the immutable and non-linear workings of the mysterious conjunction of MaH and BaN, though it may or not seem fair.
He goes on to say there that the system of reward and punishment will play itself out in the Afterlife and the World to Come to be sure (thus things will prove to be fair in the end, as others have posited which we’ll see below), but it often just doesn’t play itself out that way in this world.
Not only is that so, but in fact, the whole vexing issue of why “a righteous person sometimes does well” while at other times “a righteous person suffers” derives from this, too, Ramchal points out here.
This seeming contradiction of God’s inherent goodness and justice is discussed widely and is termed “Theodicy”. We’ll present traditional Jewish responses to it, Kabbalistic, and then Ramchal’s own.
The issue was first raised in Tanach, where Kohelet said, “I have noticed everything in the days of my vanity (including the fact that) there can be a righteous man who perishes in his righteousness, and a wicked man who lives long in his wickedness.” (Ecclesiastes 7:15) ,
And it’s discussed at great length and in depth in the Talmudic and the medieval literature, among the pre-modern and modern traditionalists, as well in the Zohar, the writings of the Ari, and in various places in Ramchal’s works, as we’ll see.
The Yalkut Shimoni (Kohelet Ch. 9, 989) takes a rather singular (so-very-human) and shockingly mordant and unorthodox view of the whole issue of the occasional and unexpected bad fortune of the righteous and good fortune of the wrongful. It says that in fact everything happens by chance, and that there’s no reason to say that the righteous should necessarily do well any more than there’s reason to say that the wrongful should necessarily do badly! We’re sure the Midrash is only expressing (and lamenting) an often-felt but ill-advised perspective on things, but it’s still an astoundingly unexpected statement .
Others acknowledge the reality of the situation and chalk it up to God’s secrets or mysteries that are beyond human reckoning 
Nonetheless, the point that will made over and over again is that the righteous will get their just reward and the wrongful will suffer in the Afterlife despite their circumstances in life, and it’s first stated in the Sifre (53) and reiterated many times over .
But there are several explanations offered for why the righteous sometimes suffer and the wrongful sometimes succeed. Some say it’s due to external reasons — because of the sins or mitzvot of their forebears , or because of the extent of the Exile and the dispersion of our people . Others say it’s the fault of the few sins of the righteous themselves and the few good deeds of the wrongful , because they weren’t zealous enough to ask God to judge the wrongful of their own generation , because of sins in past lives  or because they hadn’t been dwelling on God’s presence .
And the Zohar explains that the righteous sometimes suffer seemingly unfairly because they’re negatively affected by the sins and sinners of their generation, or so as to not sin themselves one way or another at a later point. And the wrongful sometimes succeed either because God knows that they’ll eventually repent and become righteous, because they’ll eventually have righteous descendants, or because they’ll do (or will have done) a momentous mitzvah that deserved so great a reward .
As to Ramchal himself, he agrees that the righteous suffer for the few sins they’d have committed and that they’ll be rewarded in the Afterlife for their overall righteousness, but he nonetheless doesn’t take the suffering as instances of Divine retribution but rather as “remedies” for the harm the righteous had done to themselves 
He also offers that the righteous sometimes suffer for the sake of others of their generation (thus agreeing with the Zohar cited above), and so as to bring about the ultimate Tikkun in the future, for which they are to be rewarded in the Afterlife .
But it seems that his greatest point is the one cited above that sometimes the makeup of things requires that the righteous suffer and the wrongful do well because it falls under the rubric of the immutable and non-linear workings of the conjunction of MaH and BaN. For as he ends this Petach, there seems to be no other good reason for this incongruity to exist, given that our souls are rooted in the Partzufim of the world of Atzilut. But in truth this mystical phenomenon is rooted in this hidden conjunction of MaH and BaN.
 Also see Da’at Tevunot 166.
 Also see 8:14 there; Jeremiah 12:1; Habakkuk 1:3-4, 13; Psalms 73:12-14; Malachi 3:15; etc.
 What’s interesting there is the characterization of the people who point out that the righteous often suffer in this world as people who “fold their arms (over their chest)” in underserved satisfaction, thinking they’ve made a profound and original point, when they’ve not.
 Chovot HaLevovot 4:3, Ramban’s Drasha al Divrei Kohelet, and Moreh Nevuchim 3:23.
 Shabbat 30b; Chovot HaLevovot 4:3; Ramban’s Drasha al Divrei Kohelet, and Hakdamah to Peirush l’Sefer Iyov; Kuzari 3:11; and Moreh Nevuchim 3:23.
 Berachot 7a and Chovot HaLevovot 4:3.
 Kuzari 3:11.
 Ta’anit 11a; Emunot V’De’ot 5:3; Chovot HaLevovot 4:3; Ramban’s Drasha al Divrei Kohelet and Hakdamah to Peirush l’Sefer Iyov; and Moreh Nevuchim 3:23,
 Chovot HaLevovot 4:3.
 Torat HaAdam and Sha’ar HaGilgulim 36.
 Moreh Nevuchim 3:51.
 Zohar 2, p. 10b.
 Derech Hashem 2:2:5. In fact, Ramchal very often avoids the whole notion of wrath or retribution, but that’s a subject unto itself.
 Derech Hashem 2:3:8, also see Da’at Tevunot 166 for reference to the seeming unfairness that will be proven not to be so after the great Tikkun.
(c) 2015 Rabbi Yaakov Feldman
Feel free to contact me at firstname.lastname@example.org
AT LONG LAST! Rabbi Feldman’s translation of Maimonides’ “Eight Chapters” is available here at a discount.
You can still purchase a copy of Rabbi Feldman’s translation of “The Gates of Repentance” here at a discount as well.
Rabbi Yaakov Feldman has also translated and commented upon “The Path of the Just” and “The Duties of the Heart” (Jason Aronson Publishers).