The 501st is a Mess
This shall be more of a rant, and shall begin in saying that the GAR in general, and almost every army in Star Wars too, are also a mess, they have obvious glaring irregularities in structure and organisation visible to some sub-sects of fans, which obviously originate in Lucas and most SW writers, knowing nothing or next to nothing about military organisation.
The 501, however due to its status as the most famous unit, and the one which follows Anakin and Ahsoka, thus being the one each budding SW creative wants in their film, show, book, comic etc etc, is the worst affected.
I shall present these irregularities in a tiered fashion ordered to their most glaring irregularities.
**1) The lack of an outright appropriately ranked CO**
We see in numerous forms of media that the 501 is effectively commanded by Rex despite him being just a captain, the Doylist answer for this is that Lucas wanted an Alpha-17 esque companion and settled on Rex for a name which sounds better accompanied by Captain than any other rank, however taking this within the Lore presents glaring irregularities, the 501 is a legion, which are established in lore to be commanded by a Jedi General and Clone Commander, not only that as a legion it consists of 4 Regiments also commanded by Clone Commanders, which then consist of 4 battalions each commanded by Clone Commanders, this makes the total commander billet count up to 1 Legion Commander, 4 Regimental, and 16 Battalion (this is hand waving away any Staff Officers the Legion/Regiments/Battalions would have irl, but lack again due to SW writers not knowing anything about military organisation or operations).
This would make Rex (assuming that he is the most senior company commander in the entire 501, of which when you do the math there are 64 of keep in mind) makes him the 22nd (21 Billets for Commanders) in line to assume command, now obviously battlefield promotions and casualties exist, and historically in wartime, it is possible to see some units led by men ranked at lower rank than typically, but this is always a temporary solution until an appropriately ranked CO can be bought in (or in the 501’s case 21 of them) or the temporary CO is formally promoted to fill the role, in the British and Commonwealth Armies, the position of a Brevet rank exists for exactly this sort of thing, but again in the context of wartime, they are almost always temporary.
So why then, does the Company Commander of Torrent Company also command all 9000 men in the entire legion, this would create massive implications for the effectiveness of the entire unit, Rex being at the heart of the action with his company cannot possibly effectively command the force placed under him, and the various CO’s under him can definitely not expect to be able to effectively report to him when he is at risk of death in company level actions, in real life I would point to the example of Colonel H. Jones VC of 2 Para in the Falklands, who in the battle of Goose Green, charged an enemy machine gun position and died in what despite being an effective and successful action in destroying the machine gun post, almost had disastrous implications for his battalion in losing the lynchpin of their CO, 2 Para ultimately recovered thanks to the leadership of their 2ic, a Major, but the risk in higher ranking officers getting involved is clear, as is the comparison to Rex’s style of frontline leadership, it makes him suited perhaps to being his Jedi General’s favourite clone officer and friend, but not to effective command and control.
In Legends, the existence of Appo (Legion Commander), Vill (1 of 4 Regimental Commanders, and Bow (unspecified billet) made the 501 less messy, but as seen in canon, writers made the quite frankly weird decisions to make Appo a Sergeant on Umbara and Bow a Lieutenant in his canon appearance (Vill has never appeared in canon), this decision not only stripped the 501 of an outright stated CO, but also made Appo’s path to Commander which he holds in ROTS incredibly convoluted, some offer the theory that Rex can’t be commander because of Ahsoka, we see this disproven twice, Barriss and Gree presumably both serve as Commanders under Unduli without any issue, and after we see Ahsoka leave, we still see Rex remain a Captain despite her non-existence within military operations, some others offer the theory that Rex is the overall CO because of his background as a first generation clone, battle experience, arc training, etc etc, but regardless of all of his background, accolades, achievements etc etc, being CO but not Commander is something that (if we suspend our disbelief as this being a work of fiction) be highly irregular.
**2) Lack of a definitively stated Corps, Sector Army or System Army it is attached to**
The GAR, like most real life militaries, is established as having command sized organisations in it’s structure which it’s other smaller sized units are attached to, the 501 however is never truly mentioned as being part of such structure, in fact, some sources outright state it was an independent unit which would be highly irregular, writing it as such fundamentally misunderstands the reason for similar real life structures, these structures have massive impacts on command and control, coordination, logistics, if they are an independent unit, who decides what front they are sent to, how long they stay, where they get ammunition from etc etc, the most plausible answer to me for this question is that they are part of 7th Sky Corps like the 212th, which is part of the 3rd Systems Army, this makes sense to me when the 3rd is commanded overall by Kenobi and Cody who are nominally the closest to the 501’s onscreen representation in Anakin and Rex, I’d guess Anakin became accustomed to them as a padawan serving under Kenobi and when knighted chose them as his personal unit.
**3)Lack of a defined Role**
In appearances, we see the 501 fulfil primary roles that can be defined as Armoured Infantry, Light Infantry, Air Assault, Special Operations (albeit only a few shown on screen who are not Rex, Echo, or Fives) and Jetpack Troopers (who I perhaps would put in Air Assault),a multi role unit in and of itself is not a huge irregularity, it could be that when we see these roles represented on screen we are seeing other parts of the 501, it is after all, a massive unit made up of 4 regiments and 16 Battalions, even today, there are militaries with existing regiments that have certain battalions with different roles, take the Royal Canadian regiment, that has two regular mechanised battalions and 1 regular Light/Airborne battalions (although the airborne element is limited to a company).
But to cover such a vast amount of roles as the 501 is a bit too irregular, it is a massive organisation, but considering we see our main cast of Torrent company clones performing next to all of them, leads one to believe that it is presented as the entire legion being capable, which even despite all the clones knowing since birth would be completely entirely un-maintainable from a training, logistics and command standpoint, I would recommend the book Defeat Into* Victory by Field Marshall Slim which touches on this, specialisation can and does lead to units losing skills basic soldiering and in their primary role/roles in our real world, which again suspending disbelief in Star Wars as a fictional setting, would translate there too, as the old adage says, Jack of all trades, master of none.