Two young men from Pakistan who feared persecution because they were in a homosexual relationship had their refugee claims rejected because a tribunal made "illogical" assumptions about how they would respond to their first time having sex, a court has found.

The decision of the Federal Court of Australia to send the case back to the Administrative Appeals Tribunal (AAT) to be heard again marks the latest chapter in the pair's seven-year battle to have their sexuality claims believed and to be recognised as refugees.

The two men, H and I (their identities are protected), arrived in Melbourne to study in 2009, when H was a teenager and I was in his early 20s. They had been introduced in Pakistan by their fathers who were friends, and they shared a room in Australia.

Then, they told the government and later the tribunal, they got together. After a night out in Melbourne for H’s birthday, where they danced and talked about whether they liked girls, they returned home late.

“As we were both drunk, we couldn’t control to express our feelings at that night and finally we share all those pleasures which gay couples would do,” H told the tribunal.

At the tribunal hearing in April 2016, some six years after they said they started having sex, each man told a slightly different story about what happened next. H said they did not immediately discuss what had happened and went about their normal routine the next day. He said they next had sex a couple of weeks later. The other man, I, said they did talk that night and the next day, and he thought they had sex again within the next few days.

When the tribunal asked about the discrepancy, they said it had been a long time and that they only remembered 60-70% of what happened.

In the end, the tribunal found H and I were not credible witnesses and that they were not gay, in part because that explanation was “implausible”.

Both men claimed to come from conservative families who would strongly disapprove of what they had done, and for both of them it was their first time having sex and their first significant gay sexual experience, as well as the first time they revealed to each other that they were gay.

All of those factors meant they would have been able to remember what happened afterwards and when they next had sex, the tribunal found.

The tribunal also found it was "totally implausible" that they would just go about their normal routine the following day, because there would be "much that they would want to discuss with each other" about the implications of what had happened.

Now the Federal Court has overturned those findings, saying the tribunal’s reasoning about what the men would have done after that first sexual experience was "logically flawed" and irrational.

The tribunal made assumptions about the expected psychological response — that the men would immediately discuss what had happened, and that they would remember clearly when they next had sex. But these assumptions were not proved by evidence, two of the three Federal Court judges found.

"It cannot be said that the psychological reactions of a couple to their first sexual encounter are matters of common human experience," Justices Bernard Murphy and Michael O’Bryan wrote.

"Indeed, to the extent that anything can be said about such matters from common human experience, it would be that the psychological reactions of a couple to their first sexual encounter are likely to vary widely, reflecting the wide range of human emotional attributes."

Because those assumptions were among the central reasons why the tribunal rejected the men’s refugee claims, the judges ordered the case to be sent back to the tribunal for a new hearing.

The tribunal had also taken issue with the men’s credibility because of claims they made about going to gay venues despite wanting to keep their relationship secret, and the amount of time they spent apart while travelling despite claiming to be in a committed relationship.

A third judge, Justice John Snaden, found the tribunal’s reasoning for rejecting the men’s evidence about their first sexual encounter was "fairly described as thin, perhaps even tenuous", but disagreed that it was a legal error that could be appealed.

The men first applied for protection in May 2013. A delegate of the immigration minister rejected their claim in 2014 because they did not accept the men were gay. Before the case reached the Federal Court, the Federal Circuit Court dismissed the men’s appeal from the tribunal.