Court writ filed over ‘coercive’ policy as worry over health risks rules out required reassignment surgery