WordPress reacts interestingly to domain changes and will try to "help you" by sending you to the previous official domain (even if you no longer want to use it).
There are different ways to handle this, some more involved than others.
The combination of settings, themes, plugins, content and customizations will determine the best method. It is not possible to recommend in advance.Note: Migrating from your original.domain.com to test.stackos.io, then from test.stackos.io to real.stackos.io are two domain name migrations.
Allocate a second set of servers and use migration tool to smooth out any domain changes in the database, plugins, and themes