revengineer
I am now in a situation where in would like to swap the apps installed in the main and user accounts.
Just to clarify:
main = owner profile (or "system user" as Android calls them)
user accounts = secondary user profiles?
See:
https://source.android.com/docs/devices/admin/multi-user#categories_of_users
https://seprand.github.io/articles/best-user-profile-setup/
Perhaps you could describe your setup more detailed to get better help.
Generally speaking, the only thing that comes to mind for complete backups is Seedvault, which does per profile backups.
I personally never used it and can't tell whether it can be used for changing profiles the way you plan to.
Please also note that there are many reports that Seedvault does not work reliably which seems to be one of various reasons to replace it as a GrapheneOS backup solution at some point.