You’re probably attempting to add this too early. Wait for init
.
add_action(
'init',
function () {
if ( ! wp_next_scheduled( 'send_booking_expiration_hook' ) ) {
wp_schedule_event( strtotime( '12pm' ), 'hourly', 'send_booking_expiration_hook' );
}
}
);