Why is CPFP (Child pay for parent) immune to double spend?
If you're doing CPFP right, The two transactions you sent are both originating from the same UTXO, but one spends the output of the older transaction with a higher fee.

If the miners want to get the fees of the last transaction ( the transaction with the higher fees), they will need to mine the first one aswell.

So, if your first transaction gets processed first, it's probably just a matter of time before your second one gets confirmed (due to the high fees), leaving you with the 4 bitcoin - (fees).