The rule you are thinking of is codified in Shulchan Aruch Orach Chaim 144:1.
See this shiur from R. Kaganoff for a comprehensive discussion of this topic as it relates to the haftarah for Mishpatim.
In summary, he presents three approaches that may allow the practice of jumping backwards in this case:
The rule only prohibits jumping backwards in Trei Asar, this haftarah is from Yirmeyahu.
The rule only applies when reading from a scroll, not a bound volume.
The rule does not apply to adding verses as a 'concluding song' to the haftarah.
Some key quotes:
The question is whether the rule prohibiting medalgin lemafrei’a, reading verses of a book out of order, applies only to the book of Trei Asar, or is it prohibited in any sefer navi. If it refers only to Trei Asar, then reversing direction at the end of the haftarah of Hadavar, which is from the book of Yirmiyahu, does not present any problem.
The authorities dispute which interpretation of the beraisa is correct. The Kesef Mishneh, indeed, rules that ein medalgin lemafrei’a applies only to Trei Asar and nowhere else. However, the Magen Avraham disagrees and understands that ein medalgin lemafrei’a applies to the works of any of the prophets. It is possible that our custom of skipping backwards when reading Hadavar is based on the Kesef Mishneh’s understanding of the Gemara.
[T]he Terumas Hadeshen contends, those who explain that Chazal prohibited switching prophets in mid-haftarah because of tircha detzibura will conclude that this is permitted when the haftarah is in book form ... Based on this approach of the Terumas Hadeshen, we may be able to permit going back to two earlier pesukim to conclude the haftarah of Hadavar, if we assume that the prohibition of ein medalgin lemafrei’a is because of tircha detzibura.
Other authorities provide a different reason to permit reading Sos Asis after a haftarah from a different navi. They explain that these verses are not considered part of the haftarah but a concluding song after the haftarah (Beis Yosef, Orach Chayim 144, quoting Nemukei Yosef; Levush ad loc. 144:2) ... [A]dding some verses for a pleasant conclusion is not considered part of the haftarah, and therefore does not violate the takkanas chachamim.