Mr. Z went online looking for an escort (prostitute or hooker). He found one and contacted the person to procure her for sexual activity. What will happen if it turns out that the escort was under 16 years of age?
Section 4 Criminal Code 1899 (QLD) states if a person attempts to commit an offence, regardless if the person completes the task or not, if the person takes at least 1 physical action toward the offence, he will be liable for attempting to commit an offence.
Section 218A Using internet etc. to procure children under 16
(1) Any adult who uses electronic communication with intent to procure a person under the age of 16 years, or a person the adult believes is under the age of 16 years, to engage in a sexual act, either in Queensland or elsewhere, commits a crime.
Meaning, as soon as Mr. Z started discussing for service with the escort who is under 16, without actually doing any sexual act, he is already liable under this section.
Mr. Z might say that he did not know or did not have any reasonable way to assume or believe that the escort is under 16 year of age, but he might still be liable as the law requires everyone person to ensure that a person is under 16 before engaging any sexual act.
In R v WPL  QDCSR 1123, the defended was charged for communicating with a 13 year old for escort service under Commonwealth Act.
If Mr. Z had hired her and had sexual sexual act with her, this would be an offence under s 215. Then he would have defense that he did not know or believed that the person is under 16. Read More
According to subsection 9 of 218(A)
It is a defence to a charge under this section to prove the adult believed on reasonable grounds that the person was at least 16 years.
But this is something the defendant has to prove.
So, first prosecution has to proved beyond a reasonable doubt that the defendant believed the person he was communicating with was under 16. Then defendant has to establish on the balance of probabilities that, on reasonable grounds, he believed the person was above that age.
The important part to notice that, the bar of proving the belief of defendant is much higher for prosecution than the defense.
R. v SHETTY  2 Qd R 540
R v Webb  QCA 102
R v Addley  2 Qd R 46