There are times where the RDM, or Roof Door Module, tends to get stuck in a cycle and will not move, or partially move, or windows will not go up or down, etc…. This could be caused by the RDM or associated circuits to get some stray signals and need a reset. Some people claimed that swapping relays or fuses will reset the system. Although it may seem like it works that way, what you are actually doing is removing paths in the circuit and they tend to settle down and start working again.
The best advice is to remove power from the ECM at fuse 27 for at least 30 minutes or pull power off the entire system with the battery cable at the fuse box or jump box in engine bay. While the cables are off take a look at all the ground areas on the vehicle, make sure all the other connections are good, then reconnect power and see what happens.
Troubleshooting the roof system can be complicated with all the moving parts and it certainly cannot be diagnosed without seeing it in person, but removing power and resetting the system is a good first step. If a replacement is needed note that the 03-04 and 05-06 are somewhat compatible. If you use a 03-04 on a 05-06 you will loose the outside temperature readout.