I've had this happen with one French, one Spanish, and one Italian teacher before. My personal rule is that once might be unavoidable, but twice is unreliable. Therefore I usually say something along the lines of "No problem, I hope everything is okay" the first time... but if it happens again I will not book another lesson. For me, the Italian teacher did it two weeks in a row, so I terminated the package and found another teacher, the French teacher also did it again within a couple of weeks, so I haven't booked any more lessons, and the Spanish teacher it was a one-off, and I have continued lessons with her - sometimes emergencies do come up!
It's super frustrating when it happens though. :( If you like the teacher and want to keep having lessons with them, perhaps you could tell them that you had to cancel plans and it was inconvenient, and let them know that if it happens again you might not book another class. Or if you're not particularly attached to the teacher, it could be a sign that they're not the right teacher for you.
I agree, it's very annoying, inconsiderate and unprofessional to cancel last-minute. It should not happen without a good reason.
Yet it does happen. I had a teacher who would tell me last-minute she has a "headache" or that something had "come up" - very vague - and expected us to reschedule. I ended up canceling the package because it was impossible to reliably schedule a lesson with her, and it was a waste of time I could have spent with a serious teacher or making plans with friends.
I give people one chance, sometimes two if I really like them or think they are great at their job. Beyond that, I cancel any future scheduled lessons, terminate packages, and don't work with them again, because no matter how great someone is, being reliable is the most important quality for me. I find it beyond inconsiderate and rude not to show up, show up late, or reschedule on a whim (don't feel like teaching today, rather go eat ice-cream and watch Netflix...) when someone is paying you to be there.