This is how Christ wants us to handle our failures in life. We should learn from them so we don't repeat our mistakes (leave) and we shouldn't let the failure weigh down our minds (shake the dust from our feet). We should then go on to our next task. So much of my life is stuck trying to make things work that simply do not work, or worse, I often just complain about the things that aren't working in my favor while not attempting any adjustments or changes.
This doesn't mean give up. It means stop trying something that doesn't work and look for another path. It might be that it simply was not the right time. We can go back to it later. It might be that we weren't the right people for the job. We can request someone else to help us. What we must not do is allow ourselves to get stuck in the rut of our failure.