The NSW premier’s right-hand man wanted to avoid being arrested to force him to give evidence at a parliamentary inquiry. His successful court challenge has wider implications.