A paranoid schizophrenic who fired a rifle at a neighbour and threatened him in the street with a handgun was hearing voices at the time of the “terrifying” incident, a court has heard.