“And passing by, He saw a man blind from birth. And His disciples asked Him, saying, Teacher, who sinned, this one, or his parents, that he was born blind? Jesus answered, Neither this one nor his parents sinned, but that the works of God might be revealed in him” (John 9:1-3).
“My brothers count [it] all joy when you fall into various trials, knowing that the proving of your faith works patience. But let patience have its perfective work, that you may be perfect and complete, lacking nothing” (James 1:2-4).
“Blessed [be] the God and Father of our Lord Jesus Christ, He according to His great mercy having regenerated us to a living hope through [the] resurrection of Jesus Christ from [the] dead, to an inheritance incorruptible and undefiled and unfading, having been kept in Heaven for you [the ones] in [the] power of God being guarded through faith to a salvation ready to be revealed in the last time; in which you exult; yet a little [while], if need be, grieving in manifold trials, so that the proving of your faith, much more precious than perishing gold, but having been proved through fire, may be found to praise and honor and glory at the revelation of Jesus Christ; whom having not seen, you love; in whom not yet seeing, but believing, you exult with joy unspeakable and being glorified, obtaining the end of your faith, the salvation of [your] souls” (1 Peter 1:3-9).
“Beloved, do not be astonished at the fiery trial happening among you for your testing, as [if] a surprise [were] occurring to you; but according as you share the sufferings of Christ, rejoice; so that you may rejoice exultingly at the revelation of His glory” (1 Peter 4:12-13).
“And not only so, but we glory also in afflictions, knowing that affliction works out patience, and patience [works out] proven character; and proven character, hope. And the hope does not put us to shame, because the love of God has been poured out in our hearts through [the] Holy Spirit given to us” (Romans 5:3-5). [All underlining mine]
These verses are not about masochistic enjoyment or a taking of pleasure in pain for its own sake, but for what it produces. This is not a glorying in pain, affliction, or various persecutions in a vacuum. Glory in afflictions? WHY? Because Romans 5:3-5.
1 Peter 1:3-9 reveals a grieving and an exulting according to different relations. Grieving in manifold trials and exulting in Jesus Christ.