If you remember
Scrubs after Frasier
Lost alot of its lead in viewers, but maintained a large percentage of its lead in demo score. From this NBC probably thought that the older skewing Frasier was holding the younger show back in the ratings. So they did the sensible thing and moved it after Friends, which looked a more compatible, younger lead in.
Scrubs did not work after Friends. When they were both in New episodes it never retained more than about 75% of Friends audience. NBC at the same time had the threat of CBS overtaking them. It was too valuable a slot to waste, to NBC credit they did give it a season and a half in the slot to find an audience. They then gave it a chance in the post W&G slot, where it was generally easier for comedies to keep their lead in as of the smaller lead in audience, not facing the survivor second half, and having er following it. Remember even Just Shoot me had flurished in this slot. Again it couldn`t maintain its lead in.
Now lets be honest, if you were head of NBC with no crystal ball, and had to fill the 9 to 10pm Tuesday hour. You know that the 8pm hour is usually a desert island for ratings. Do you give the 9pm slot to a comedy that is funny, but has never been able to maintain a decent amount of its lead in, or a new comedy that has a gimmick that it is CGI, has a pedigree of Shrek, and did get alot of buzz before it premiered.
And i just have to repeat that i am a big fan of
Scrubs, but at the end of the day i dont think you can blame NBC for its low ratings, you just have to blame the viewing public. NBC has shown a lot of patience with this show.