A sub panel is not service equipment
240.1 Scope.
Parts I through VII of this article provide the
general requirements for overcurrent protection and overcurrent protective devices not more than 1000 volts, nominal. .........
article 240 is not related to specifically service equipment but there is no such thing in the code as a "Sub-Panel". If you are looking at 240.24(E) in the highlight section
"{
240.24(E) Not Located in Bathrooms.
In dwelling units, dormitories, and guest rooms or guest suites, overcurrent devices, other than supplementary overcurrent protection, shall not be located in bathrooms.}"
"supplementary overcurrent protection" is not a "sub-panel" per definition.
2023 Article 100 definition:
"Overcurrent Protective Device, Supplementary. (Supplementary Overcurrent Protective Device)
A device intended to provide limited overcurrent protection for specific applications and utilization equipment such as luminaires and appliances. This limited protection is in addition to the protection provided in the required branch circuit by the branch-circuit overcurrent protective device. (CMP-10)"
in '23 240.24(E) was changed to add (highlighted)
"(E) Not Located in Bathrooms.
Overcurrent protective devices, other than supplementary overcurrent protection, shall not be located in bathrooms,
showering facilities, or locker rooms with showering facilities."
and eliminated the reference to dwelling unit etc. causing the coverage of this article to be expanded to other occupancies.