Job 27:7

Let mine enemy be as the wicked, and he that riseth up against me as the unrighteous.

Job 27:7 occurs within Job's answer to his companions who had judged him unfairly in their controversy over suffering. There he voices the desire that his adversary be reckoned as belonging with the wicked, and that everyone rising up against him be reckoned as belonging with the unrighteous.

The utterance belongs to that dispute and does not lay down a general principle that affliction proves a person wicked. His companions erred in taking their observations about the wicked as proof that his calamity showed God's displeasure against him.