I see similar questions have already been asked about this passage but there was a lack of definite answer, some see it as a series of mistakes.
I have been trying to understand the exact nature of Saul's sin surrounding the offering he sacrificed and his subsequent rejection. It seemed he was predestined to fail for David to be chosen.
-Was the sin the fact that he wasn't a priest, type of sacrifice, or that he didn't wait for Samuel to arrive (panicking because he was late), or was it the disobedience that caused God's anger? Or just that he had a lack of awareness of the presence of God and wasn't "after God's own heart"?
What was the commandment that Saul broke?
To be chosen and then rejected by the Most High God must have been the depths of misery, I cannot think of anything worse. I want to understand exactly what he did wrong.
And Samuel said, “What have you done?” Saul said, “When I saw that the people were scattered from me, and that you did not come within the days appointed, and that the Philistines gathered together at Michmash, then I said, ‘The Philistines will now come down on me at Gilgal, and I have not made supplication to the Lord.’ Therefore I felt compelled, and offered a burnt offering.”
And Samuel said to Saul, “You have done foolishly. You have not kept the commandment of the Lord your God, which He commanded you. For now the Lord would have established your kingdom over Israel forever.
But now your kingdom shall not continue. The Lord has sought for Himself a man after His own heart, and the Lord has commanded him to be commander over His people, because you have not kept what the Lord commanded you.”
I Samuel 13:11-14 NKJV https://bible.com/bible/114/1sa.13.11.NKJV