https://learn.microsoft.com/en-us/sql/relational-databases/databases/attach-a-database?view=sql-server-ver16
"We recommend that you move databases within an instance with the ALTER DATABASE planned relocation procedure instead of detach and attach, when moving database files within the same instance."