You need to be talking to a lawyer. I suspect that the court was unimpressed with the "emergency" aspects and you need to pursue a normal custody change.