User edit form on custom page is resetting roles when user belongs to the "Administrator role"
The form values still persist in the form state, and as they're not printed, the will be submitted as empty and saved accordingly.
Do not hide form element by not outputting them in twig, render the full form there and use [#access] = FALSE; on the form elements you don't want to show. Do so in the controller, to only have that on your custom page. If you do that in hook_form_alter it will apply to the form always (so here also for the profile page aka /user/X/edit).

You're mixing two concepts: Showing a form (where you have full
control and can add stuff before and after with entries in the render
array and use a form-mode for the form, so you can configure the
fields via UI and not code) and altering a form (where you do not
control where it is shown, and want to change it everywhere). I guess
you want to show a form, so I would remove the theme stuff and
concentrate only on the output form your controller.

Or even use a different approach .. and create a new form from scratch, populating with the user's value, and save them back to the user entity on submit (If you only need one &quot;field&quot; and even the password fields can be replicated in the custom form).
And replace the controller with a form callback in routing.yml.