No it could never be legal.
The NEC states that the Main Panel ( used for clarity ) needs to be as close as possible to the point of entrance from the outside meter can. While this distance can vary it would not be in most cases longer than 3-6 feet. In my area they will allow 3’ of SE cable within the structure before it MUST terminate into an enclosure with an OCPD.
Now if you were allowed to simply TAP it within the enclosure it would still violate this requirement and put unprotected SE conductors within the structure.
I do understand where you are going and YES in a technical sense it has the same " POTENTIAL " as the main panel but just because it is tapped incorrectly or correctly to the service does not make it a main service panel since other factors MUST be in place.
Many of the items are in concept for understanding, many things in the electrical world you simply can’t use logic for and in this case we see one of them. Even if the conductors were tapped lets say legally…they would not be protected running thru the structure and a violation of the NEC which is a minimum safety standard protocol.
again no situation would make them legal as they stand now, we don’t know the other varibles as well in regards to the kind of wire ( 3 or 4 conductor ) that was run to these panels either.
OH…I had to add this ; I do understand you fella and in a working sense YES it works but no it is not safe and in the end safety is what we are going for when dealing with electrical wiring.