As for wondering where or why the followers of Jesus would be carrying a sword Not all who followed Jesus were disciples. consider the centurion mentioned in Mattew 8:5-13. I don’t know if he in particular was traveling with Jesus, but is it likely that among those who were would be other members of the Roman occupation.
So, it remains to be discerned, why in these instructions so near the end of his ministry on Earth did our Lord say to carry a sword?
In my unschooled opinion, this was a warning, not necessarily concerned with the swords themselves, but a warning in the vein of John 15:18.
While part of what the roman occupiers were doing there was to keep civil order, they did that as occupiers and could not be counted on to always protect the people, including those who Jesus was preparing to go into all the world to preach. Roman law and order was problematic at best, and brutal when challenged.
It would be prudent to avoid being reliant on those with loyalties that may be in conflict with the travelers.
In another thought, it is interesting to look at when and who and how provisioned the Lord sent his followers out. Consider why our Lord may have made these choices, and what were the results.