The derivative test claims that _local extrema_ in the _interior_ of the domain are to be found among the zeros of the derivative; as noted above, in this case $\pm{\frac{\pi}{6}}$ are the zeros of the derivative and it is easy to see that the plus one is a local maximum and the minus one is a local minimum.
However, the boundary points need also to be checked as there the function may have an extremum without the derivative being zero, and in this case it is trivial to see that $-\frac{\pi}{2}$ is _the global minimum_ attained at $\frac{\pi}{2}$ since $\sin({2x}) \ge 0, x \in [0,\frac{\pi}{2}]$, hence $\sin({2x})-x \ge -x \ge -\frac{\pi}{2}$ there while the function is odd and for negative $x$ obviously at least $-1$ (actually the local minimum for negative $x$ is at $-\frac{\pi}{6}$ and hence it is $-\frac{\sqrt{3}}{2}+\frac{\pi}{6}=-0.34...$