HONG KONG—Hong Kong’s top court ordered media tycoon Jimmy Lai, the most high-profile person to be charged under the city’s national security law, back into custody on Thursday, saying a judge may have erred in a decision to release him on bail. The Court of Final Appeal’s ruling comes a week after Lai, one of Hong Kong’s most prominent democracy activists who is accused of colluding with foreign forces, was released on HK$10 million ($1.3 million) bail along with extensive restrictions that included barring him from using social media. Lai, 73, was in court. He was not immediately available for comment after the ruling but is due back in court on Feb. 1 for another appeal hearing regarding his bail, the court said. Beijing imposed the national security legislation on the former British colony in June after months of pro-democracy protests. Critics say it is aimed at crushing dissent and …