I get this problem every day or two when trying to connect my ATV 2 running 5.1.1 to iTunes 11.0.1 on an iMac running OS X 10.8.2 (though it started happening with earlier releases of both ATV software and iTunes. I think it started happening regularly following the installation of the ATV 5.0 software, with I think iTunes 10.6 or thereabouts.) They're connected over WiFi via an Airport Extreme basestation.
The TV simply shows a black screen with:
'Could not connect to "<iTunes library name>"'. 'Make sure the computer is on the same network as your Apple TV , the iTunes version is up to date, and iTunes is running.'
I've found the way to fix this problem when it happens is to restart the Apple TV (Settings>General>Restart). This always seems to correct it and allows me to connect to iTunes successfully once again, but the problem always returns sooner or later and I've not been able to determine what triggers it exactly. It seems to happen more often if the iMac running iTunes has been put to sleep with iTunes running and subsequently woken, but it also happens sometimes when I wake ATV and try to connect it to a freshly booted iMac and newly launched iTunes.
I keep hoping a new release of ATV software will fix it but neither 5.1 nor 5.1.1 made any noticable difference and neither have newer releases of iTunes.