Following on the Confederate evacuation from Corinth end of May 1862, many in the Government at Richmond became quite unhappy with the performance of General PGT Beauregard. President Jefferson Davis, in particular, harbored a grudge that stemmed from Beauregard's publication of his Manassas report in newspapers (criticizing Davis' role in not promoting pursuit of the retreating Federals as they fled pell- mell towards Washington.) The grudge festered with the death of Davis' friend, Albert Sidney Johnston at Shiloh, and Beauregard's cavalier report of that man's death, tacked into a telegram claiming Complete Victory on April 6th. The final straw that broke the camel's back was Beauregard's "unauthorized" evacuation from Corinth, without first engaging Federal forces in battle. It appears President Davis merely bided his time... and when Braxton Bragg reported that Beauregard had departed on sick leave (for a health spa near Mobile) the opportunity presented, and Davis struck, replacing Beauregard on 17 June 1862 with Bragg as commander of what would now be called the Army of Tennessee.
Stephen R. Mallory, Confederate Secretary of the Navy, was one of the few Cabinet officers to keep a diary. His entry for 21 June 1862:
"Interesting Cabinet meeting yesterday. President had ordered Bragg, who was second in command at Corinth, to proceed to Mississippi and assume command. Beauregard would not permit Bragg to go, but left Bragg in command, and goes himself to Mobile for his health. Beauregard, with the finest army ever found upon this continent, about 100,000 strong, remained about six weeks after the battle of Shiloh inactive, with the enemy in his front, and then retreated without notice to the President or War Department. And up to this time no reason for his retreat is known, and now he abandons his army without leave or notice. My own idea is that his mind has given way under the weight of his command; and that finding Bragg about to leave him, he ran away from an army he could not manage. If a soldier were thus to go off without leave he would be tried for desertion and be probably shot, and an officer would be shot or cashiered. Beauregard has never voluntarily fought a battle... and never will. Bragg is left in command, and he may do better."
https://finding-aids.lib.unc.edu/02229/#folder_4#1 Diary of S.R. Mallory, Secretary of Navy (CSA) at Uni North Carolina Library.