E.g. you can take action A on your laptop, followed by action B on your phone. Undoing action A may not be easily possible if it was followed by action B.
To make that work properly you need to activel sync states between all the users devices using e.g. websocket or what-have-you. Handling edge cases becomes quite the nightmare, e.g. phone has poor connectivity.
Only the big guys would have budget to do these sort of things (And make them work well).
In other words, if you delete an email and it goes to the trash folder: good use of toast + undo
If you empty the trash, and there is nowhere the user can go to unempty it: bad use of toast + undo
Its also useful as a sleight of hand eg when cancelling an action you havent yet taken (which actually is generally what a toast + undo actually is). The best example of this being toast + undo for an email send