The man who attacked two strangers hours after he was released from a mental health care unit has had his appeal against his sentence refused.