The underling issue in your question is a misconception of Allah’s character. He is Merciful and Benevolent, but He is not only just Merciful and Benevolent. He is also Just (16:90), He is Vengeful (3:4) and He is a Giver of stern punishment (85:12).
The truth is, Allah’s is overflowing with love, forgiveness and mercy for those who submit to Him or are in some error and He hopes that they will in time come to Him. He, however, has no soft spot for His enemies i.e anyone who openly rebels against Him and continue to rebel against Him until they die. Such people will be called to a harsh account by Him and that is the thing, you ask why Allah didn’t prevent this, the truth is, because Allah does want to seize the Rebellious, He values justice more than any of us. He’s the King of Kings, no rebel can offend His majesty and then can happily walk away freely, He will indeed, at least make them stand for Judgment even if He does ultimately choose to withdraw His warning of eternal Hell.
As for those who do submit to Him and sin or make error time to time but ultimately seek His forgiveness, He is Merciful and Benevolent to them. As for the one who is His enemy, He created them, they choose their path of rebellious out of their free will and now He’s going to punish them because their life has served as evidence against them. This differentiation between the Obedient and the Rebellious is the major part of His Justice. If He lets go the rebellious (by not creating them) just like He lets go the obedient, then Justice suffers.