I always assumed that this could not make its way into the ledger, but while testing with (seemingly) invalid transactions, I created the following:
A custom asset
I created a custom asset. As you can see in the lab explorer, I issued an amount of 4000 units.
I funded a new account
A simple account with a little amount of the asset
I created a transaction for the account to send itself much more of the asset that it owns
Actually, way more of the asset than actually exists. There were 4000 issued, but I sent a payment over 12312312313.0000000.
You can see the operation here.
Good thing: It did not actually get applied
When we look at the account we see that I was not able to overspend.
Confusing: Why was this transaction successful and made it into the ledger?
The transaction containing the operation was successful. You can also see this in the result XDR.
This is confusing to me. I would have assumed that this would not be accepted into the ledger. I would be very grateful for some hints, why this happened :)