The good news is that your proposed closet is big enough
The good news about your plans is that your proposed electrical closet is indeed large enough to house the clear working space for your electrical panel (30" wide by 36" deep, though not necessarily centered on the panel), as well as a future subpanel adjacent to the existing panel and sharing its working space, as long as the existing panel is 6" deep or less, which is true for just about all residential loadcenters.
Keeping pesky storage out ("Do this, Don't do that, Can't you read the signs?")
The main issue with your closet plans, like with dedicated electrical closets in many commercial spaces, is the penchant for people to not know that the NEC means what they say when they talk about clear working space for panelboards. In fact, NEC 110.26(B) explicitly says that electrical working space shall not be used for storage:
(B) Clear Spaces. Working space required by this section shall
not be used for storage. When normally enclosed live parts are
exposed for inspection or servicing, the working space, if in a
passageway or general open space, shall be suitably guarded.
To this end, a sign on the closet door reminding you and yours that it's an electrical closet and not a storage closet:
would be wise; these signs are available both as vinyl decals for use on solid doors, or as aluminum signs that can be screwed to a solid or slatted door, and aren't all that expensive in the grand scheme of things.