Every educational program, whether divine or human, is composed of two components: Encouragements and warnings.
Encouragements are there so that people are motivated to do something and warnings so that they fear the consequences of not doing what they should do or not avoiding what they should avoid.
These two, namely encouragements and warnings should come together. If there is only Bisharat, it is the path of Judaism in which there is no warning.
On the other hand, if there is only warning, people would fear so much that they will see themselves incapable.
There were some people who denied hell. God told them: “This, then is Gehenna (Hell), that which you were promised.” (Verse 63 of Surah Yasin)
Some may wonder whether people would go to hell without a trial and sentencing. They won’t. There is assessment of deeds before anyone is sent to paradise or hell.