Hi,
please check whether dbcc checkalloc (dbname) will reconcile the dbids. When I used the unmount & mount functionality checkalloc had to be used because of the dbids. It is executed before you set the database online.
dbcc checkalloc (prod)
go
online database prod
go
Best regards,
Juergen