to fix on the Z dimension, use scale, S Z 0
Then you can use "to sphere"
ALT SHIFT S and dragging to the amount
or pressing 1 to get 100% circle
this after fixing Z as above
 Now, I see from your "desired" that the loops are not necessarily on the global XY plane, so my method above is not entirely sufficient.
I found a way to fix that, too, maybe you know this already but: after "scaling Z 0" your edge will be aligned to XY, as said, which is not what you want. Unfortunately there is not (afaik) a method to directly achieve what you want, but you can do this:
- before "scaling Z 0", add a new object, a simple circle, and try to put it on your desired final position.
- then, edit you more complex shape with jagged edges, do "scaling Z 0"
- then, with that now Z scaled edge loop, view it from the side
- then activate snapping to edges (header icon list next to magnet)
- now, in edit mode from the side view, rotate/move the edge loop, snapping it to the "simple circle" you placed before, even acting from other sides.
- when your corrected edge loop is now aligned as it should, you can then delete the simple plane you adde just for this scope. Tell me if you need a more detailed example.
[edit2] after your comment, I add some more image about point 1-6 just above:
As in your example the shape has jagged edge loops not aligned do any global plane at all: you add a simple circle (on the left) and place it where the final edge loop needs to stay
then, you scale Z 0 the jagged edge loop, that also align it to XY
then, using the snap to edges tool, you rotate it to align to the previously placed simple circle which is "in the right position"
so now your edge loop is again in its original position (you just need to use "to sphere", as said at the start, to smooth it completely) and you can remove the simple plane just used as reference