(Reuters) - U.S. Army Sergeant Bowe Bergdahl had devised what he told a military investigator was a “fantastic plan” to leave his post so he could inform higher-ups about problems in the ranks, but that fell apart when he realized he took on more than he could manage. Bergdahl, 29, who walked away from his post in Afghanistan in 2009 and became a Taliban prisoner for five years, is facing a court-martial with a potential life sentence on charges of desertion and endangerment of U.S. troops. In a 371-page interview made public on Wednesday, Bergdahl said he was frustrated and concerned about the command at his post in Afghanistan, seeing it as incompetent, immoral and putting soldiers’ lives in danger. He devised a scheme to leave and travel by foot to a military command about 20 miles away, with his disappearance causing a full-scale search. When he arrived, he thought this would get him an audience with a general to air his grievances. “I came up with a fantastic plan,” he told the military investigator in 2014 about three months after his release. “I was seeing things heading in a very dangerous direction. So, I had to do something.”  He left at night and was captured the next day by the Taliban.   “By daylight, I will admit I was in over my head,” he said in the transcript released by Bergdahl’s lawyer Eugene Fidell, of an interview with Army investigator, Major General Kenneth Dahl, in 2014. At the end of the interview, Dahl mentioned desertion, AWOL and fraudulent enlistment offenses to Bergdahl but made no mention of the more serious charge of endangering U.S. troops, which carries up to a life sentence, according to the transcript.  At an evidentiary hearing in Texas in September 2015, Dahl said he did not believe Bergdahl should be jailed for what he did. He said Bergdahl was not a Taliban sympathizer and characterized him as an unrealistically idealistic soldier.  Dahl also said no soldiers directly involved in the search for him were killed. U.S. military prosecutors have said Bergdahl sneaked off his  post, resulting in a 45-day search that put soldiers’ lives at risk and diverted attention from the fight against the Taliban. Bergdahl was freed in a prisoner swap in May 2014 involving the release of five Taliban leaders held by the United States. The deal drew heavy criticism from Republicans. 