Pages are not actually stored in folders. They are all in one big common “folder” if you will. (not really a folder, they come from a DB table). The “folders” that are part of a permalink path are principally for SEO, they are not generally used internally to fetch pages. Pages are fetched based on their slug, the rest is supporting information.
You can manage what pages are fetched by other criteria besides page slug. For example, a page slug could be “hx9os4hsf” for all it matters, e.g. gibberish. What would be crucial is it’s title is “Main” and it is tagged with “main” and “usera-id”. You could request mydomain.com/tagged/USERA-ID/main/ where the last two “folders” are used to qualify the query by corresponding tags assigned to a page. Only page “hx9os4hsf” would match both tag criteria.
Another possibility is to make use of pages hierarchical nature. Every user could be given a top level page matching their user name. This page itself doesn’t need to be visible on the front end, it’s used for organizational purposes. Every one of these top level pages can have their own child page named “main”. This is allowed because “main” is always referenced through its parent page. The page is then requested just like you want. WP would handle this automatically by virtue of the parent page matching a user.
This sounds like I’m contradicting myself from previous assertions. The fact there is a parent page matching the user is a crucial difference. It’s not possible to have duplicate page slugs unless each has a unique parent page.