Queensland’s Environment Department made a mistake in how it decided to allow a Gold Coast couple to keep a magpie they made into a social media star, a court has found.