A Sydney man who is accused of defacing a police memorial has lost a court bid to be released into a mental health facility.