"Carry out" here is an idiom meaning to do something that was commanded or planned. This can be stated in active form. AT: "when the people were about to obey the king's law and decree" (See: [[rc://en/ta/man/translate/figs-idiom]] and [[rc://en/ta/man/translate/figs-activepassive]])
"the situation was reversed." The situation being reversed is a metaphor meaning that the opposite of what was expected happened. AT: "the opposite happened" (See: [[rc://en/ta/man/translate/figs-metaphor]])