There appear to be contradictory verses / explanations.
Numbers 14:25:
וְהָֽעֲמָלֵקִ֥י וְהַֽכְּנַעֲנִ֖י יוֹשֵׁ֣ב בָּעֵ֑מֶק מָחָ֗ר פְּנ֨וּ וּסְע֥וּ לָכֶ֛ם הַמִּדְבָּ֖ר דֶּ֥רֶךְ יַם־סֽוּף׃
Now the Amalekite and the Canaanite dwell in the Vale; tomorrow turn ye, and get you into the wilderness by the way to the Red Sea.’
According to this verse, G-d says that the next day, they should travel away from Kadesh.
Contradicting this, we see Rashi on Deuteronomy 1:46:
Rashi on Deuteronomy 1:46:1:
ותשבו בקדש ימים רבים.
תשע עשרה שנה, שנאמר כימים אשר ישבתם בשאר המסעות והם היו שלשים ושמנה שנה, תשע עשרה מהם עשו בקדש ותשע עשרה שנה הולכים ומטורפים וחזרו לקדש, כמו שנאמר (במדבר לב, יג) ויניעם במדבר כך מצאתי בסדר עולם:
"You dwelled in Kadesh many days" - Rashi explains that this was 19 years.
Explain the apparent contradiction between Rashi's analysis in the verse in Numbers that seems to indicate that G-d commanded them to travel away from Kadesh the next day. It looks like something happened between that command and the "tomorrow" mentioned that made them stay in the same place for 19 years.