Govt confused in court over gay sex stand