Today we use the phrase to mean someone who is seen an irrational, perhaps eccentric, crazy, mad or even intoxicated. It is often used in a friendly way rather than being seen as an insult.
There are no definitive answers as to where the idiom originates from, but the most favoured theory could take us back to Victorian times. On hospital campuses, the mental institution would be hidden behind the main building. So to 'go round the bend' literally meant to use the driveway as a way to get to the mental hospital at the rear of the campus.
It seems 'around the bend' has lost its scathing associations with mental illness, as noted last year with the origins of 'Tom foolery' and 'bedlam', both of which come from the St. Mary of Bethlehem Hospital in Bishop's Gate, London, the first hopsital in Europe to 'deal' with mental illness in the sixteenth century.
To be 'round the bed' could also explain the etymology behind the phrase to be 'round the twist'.