The mob call for stoning Joshua and Caleb had nothing whatever to do with law breaking. Indeed, stone was reserved only for very serious crimes.
In Num 14:10 it was an expression of mob violence resulting from a mixture of anger and frustration - an extremely dangerous mixture as many leaders discovered on other occasions. In this mob-anger context, stoning is completely illegal, unethical and immoral!
Note the comments of Ellicott -
Under the Jewish law stoning was the ordinary, and, as some think, the
only prescribed mode of death, and was inflicted as the punishment for
crimes such as adultery (Deuteronomy 22:22; Deuteronomy 22:24),
idolatry (Deuteronomy 13:10), witchcraft (Leviticus 20:27),
sabbath-breaking (Numbers 15:35), and blasphemy (Leviticus 24:16).
Moses had apprehended the same outbreak of popular violence on a
former occasion (Exodus 17:4), and, at a later period, David was
threatened in a similar manner (1Samuel 30:6).
The Cambridge commentary correctly calls this act, "mutiny". It might also be called, sedition or treason. Because this also involved disobeying the word of the LORD, it could also be labelled "blasphemy" as well.
Note the comments of the Pulpit Commentary
Verse 10. - Bade stone them with stones. Angry people cannot endure
the counsels of calm reason, and perhaps the hostility which they felt
against Moses they were very ready to vent upon his "minister."
Thus, the mob wanted to stone the leaders, NOT because the leaders had broken any law, BUT because they we about to commit treason and thus, break the law themselves.