When tempted, no one should say, "God is tempting me." For God cannot be tempted by evil, nor does he tempt anyone; (James 1:13)
Certainly that Scripture as all Scripture is quite true.
However, there are other Scriptural indications that this whole life is a test, training etc.
And, of course, there’s the case of Job.
I think there are myteries and complexities on the issue that are difficult to sort out and articulate.