I have this as well, I'm convinced its an O2 thing... or a network thing anyway. Its always in a place with bad 3G, I find what happens is it says 3G but won't work, as you say, and sometimes after a while, it flips to Edge or GPRS and then works fine at those speeds.
I've noticed it happens very often in a particular house in London, where the 3G connection is dodgy. Most of the time, I'll get GPRS, and data will be consequently very slow. Occasionally, I get the 3G icon, during which I get no data. After a while, the phone will drop the 3G network again and go back to GPRS and then data will work again.
Anyway the symptoms my phone shows are consistent with that explanation: if you are somewhere with, say, coverage for the 1800Mhz network for GSM, and marginal connection to the 2100MHz UMTS network, I suppose the phone will try to get 3G through that UMTS, but the connection will be bad enough that it can't actually shift any data. If it fails and you get enough of a dip in 2100 signal that it no longer detects it, it will instead try to use the 1800MHz GSM to get data using GPRS.
Perhaps theres some effect of O2's new 900Mhz UMTS band adding to the mix in major cities as well.
so I guess it happens in a place where you have good GSM (hence the phone and texts and reasonable signal strength bar), but marginal UMTS... enough that it thinks it can get 3G, (so doesn't step down to GPRS), but the signal isn't really good enough...