Obviously there are sociological differences in how we view the childhood/adulthood divide and Lafayette was a special individual. I also understand that enlisted soldiers could feasibly go as young as whoever can hold a gun. However, I have a hard time believing that putting an 8th grader in charge of a military function would be a pragmatic idea even in the most desperate of situations. I am trying to find sources that say how well 13 year old lieutenants performed (may have been very well), I am just coming up blank.
I'm not sure if this will exactly answer your question, but it was not uncommon for teenagers and even younger children to serve in the Royal Navy at those ages. I've written about midshipmen in the RN before. To quote from that answer:
To become an officer in the Napoleonic period, a man would need to have entered the navy at a suitable age (certainly no older than 14) to build up enough sea time and practical experience to pass a lieutenant's examination, which required that the examining board be presented with evidence that he had spent six years at sea (at least two of them in the Navy) and that he "appeared" to be 20 years old, which was the minimum age to become a lieutenant. And yes, the point of boys going to sea that young was eventually to attain commissioned rank.
In the period of the Napoleonic wars, many boys went to sea as young as 11 or 12 to start building up the required sea time, or were at least put on ship's books by captains who were friends or relatives of their families to start building up the required sea time. It wasn't uncommon for boys to be placed on the books even earlier, and this practice (though technically illegal) was viewed with some benevolence, because as navigation (particularly finding longitude) became more complicated, most boys needed a few years of schooling ashore, particularly in mathematics.
Once a midshipman had built up the required sea time, he would have to sit for a lieutenant's examination in front of a panel of captains, where he would be grilled on practical seamanship, navigation, mathematics, geography, history or really anything else the board wanted to throw at him. There wasn't a standard examination, so it was quite possible that sympathetic boards could pass men rather easily (Horatio Nelson's stepson rather famously became a lieutenant at around 16 and a post-captain at 17, due to Nelson's intervention and "interest" in his future, despite being spectacularly unqualified for the job).
Once a man became a lieutenant, he would have to rely on luck and his own "interest" from sponsors for further promotion. The first lieutenant of a ship was often promoted after a successful action (this was seen as a compliment to his captain, oddly enough). A lieutenant's next step would be as a master and commander of a vessel; he would by courtesy be called a captain at that point, but it wasn't until he was promoted to captain of a post-ship that he would be called a post-captain, or just captain, and be assured of (if he lived long enough) dying an admiral. Once a man was a post-captain, his further promotion was entirely based on seniority on the list of captains. (What's a post-ship? In confusing logic, a post-ship is what a post-captain would command. In practical terms, it usually meant at least a frigate, although sometimes smaller ships were considered post-ships out of courtesy to a captain.)
So yes, it was common for boys to be midshipmen in the navy of the time. They could even command prizes and other ships (certainly with the strong help of an experienced warrant officer and other seamen) as part of their training, or command a ship's boat in a landing or cutting-out expedition. Many were killed or wounded in battle.
I also wrote a longer answer about the way in which the chain of command worked during this time: https://www.reddit.com/r/AskHistorians/comments/29f3s7/how_does_the_royal_navys_organisation_command/
Something to keep in mind is that midshipmen were considered officers as a courtesy -- they were technically master's mates, that is, mates (subordinates) of the ship's sailing master, who was himself a warrant officer. (Warrant officers are those holding a warrant from the Admiralty or their particular administrative organization, occupying a middle ground between commissioned officers and enlisted sailors.)
Midshipmen did not themselves hold a warrant -- if they passed for lieutenant, they would become a commissioned officer -- but were allowed to berth near the other warrant officers and would be part of the ship's chain of command. A misbehaving midshipman could be stripped of his status as a master's mate and "turned before the mast," becoming a common sailor; on the other side, it was rare but not completely unknown for a common sailor to become a midshipman and eventually an officer.
Many here have written about the progression of young teens from midshipman to officer in a navy.
What about armies? Did the same happen there? You needed to learn a lot of basic skills quickly to command a sailing ship and a junior officer could still potentially command a prize.
Would there be the same need to learn independence so quickly in an army? Would a junior officer have the same need to act independently?