In a Stellar transaction, if I set the cutoff ledger to 510, why is ledger 510 already too late?

Stellar's transaction precondition, ledgerBounds, restricts which ledgers a transaction can be included in. Under protocol CAP-0021, the ledger number must be greater than or equal to minLedger and less than maxLedger. The upper bound specifies the first ledger that will not accept the transaction.

For example, setting minLedger to 500 and maxLedger to 510 allows the range from ledger 500 through ledger 509. If the intended behavior is to allow execution in ledger 510 as well, the upper bound should be set to 511. There is another boundary that is easy to misread: maxLedger set to 0 means there is no upper bound; only the lower bound is checked. All ledger numbers above are examples for illustration.

When displaying the validity range before signing, you can explicitly write “last ledger allowed.” If no upper limit is set, display it according to the field’s actual meaning, and continue checking whether the transaction has other restrictions. When troubleshooting expiration, also use the fields actually included in the transaction signature to check the ledger sequence at execution time.

$XLM #Stellar

Source: https://github.com/stellar/stellar-protocol/blob/master/core/cap-0021.md