A bid to convert a city centre dental practice into student flats has been quashed by the government's planning inspector.