Judg 11 portrays the Israelites going around Edom and Moab:
17 Israel then sent messengers to the king of Edom, saying, ‘Let us pass, we pray, through your land’; but the king of Edom would not listen. And they sent also to the king of Moab, but he would not consent. So Israel remained at Kadesh. 18 Then they journeyed through the wilderness, and went around the land of Edom and the land of Moab, and arrived on the east side of the land of Moab, and camped on the other side of the Arnon; but they did not enter the territory of Moab, for the Arnon was the boundary of Moab. 19 Israel then sent messengers to Sihon king of the Amorites, king of Heshbon; and Israel said to him, ‘Let us pass, we pray, through your land to our country.’
Judg 11:17-19, NABRE
Deut 2 (NABRE) seems to contradict this, saying the Israelites went through Edom and Moab:
4 Command the people: You are now about to pass through the territory of your relatives, the descendants of Esau, who live in Seir... 8 So we passed by our relatives, the descendants of Esau who live in Seir, leaving behind us the Arabah route, Elath, and Ezion-geber.
The Israelites go through Edom.
Then we turned and passed on toward the wilderness of Moab... 13 Now get ready to cross the Wadi Zered. So we crossed the Wadi Zered.
The Israelites enter Moab from the south.
16 When at length death had put an end to all the soldiers among the people, 17 the Lord said to me, 18 You are now about to leave Ar and the territory of Moab behind... 24 Advance now across the Wadi Arnon.
The Israelites exit Moab from the north.
28 The food I eat you will sell me for money, and the water I drink, you will give me for money. Only let me march through, 29 as the descendants of Esau who dwell in Seir and the Moabites who dwell in Ar have done, until I cross the Jordan into the land the Lord, our God, is about to give us.”
Moses asks Sihon to let them pass through Amorite territory, saying Edom and Moab also let them through.
The Hebrew word translated as "cross" or "pass through" is עבר, which can also mean "pass by." עבר is also used when the Israelites "leave Ar and the territory of Moab behind." However, given that עבר is being used in reference to borders, it would make more sense for it to mean "cross." I don't have even a beginner's understanding of Hebrew, so please correct me if I'm wrong on this.
How are these two narratives reconciled?
I found a related question, but my question asks about both Edom and Moab. Also, the accepted answer to the linked question reconciles Deut 2 with Num 20:18-21, not with Judg 11.