Hong Kong's judicial independence is being questioned following the unexpected resignation of a foreign judge from the city's top court who cited the city's controversial new national security law as the reason for his departure.