reminder wp_schedule_event

It’s because your code is explicitly written to ignore whether or not the event is in the past or the future.

See here:

$diff = strtotime($my_meta) - strtotime($datetime2);

If the event date is in the future, $diff will be a positive number, but if it’s in the past, it will be a negative number. Then the very next line is:

$gap = abs(round($diff / 86400));

The whole point of the abs() function is to make sure a number is a positive number. Which means that the result will be exactly the same whether the event is in the past or in the future.

If you only want to send a notification for upcoming events then you need to know if the number is negative. So just remove abs() and make sure that you’re only checking for 3 and not -3:

$diff = strtotime($my_meta) - strtotime($datetime2);
$gap = round($diff / 86400); 


if($gap === 3){
    // etc.
}