Manufacturing queue order bugged

Sometimes when I add new things to the queue or change priorities, the order gets messed up and I have to rearrange everything to get the order I want. Sometimes doing this works, and sometimes it messes up again while doing it.

I’ve noticed this on 1.7.1, but as I usually don’t have a long manufacturing queue, the bug may be older than that. The campaign was started in 1.7.0.