Savepoints in Apex are markers within a transaction and rolling back to an earlier savepoint (SP1) invalidates any savepoints created after it. Thus, SP3 is invalidated when the code rolls back to SP1, causing a runtime error when a rollback to SP3 is attempted. References: Apex Developer Guide - Savepoint and Transaction Control