This code in your functions.php fixes this behavior:
add_action('init', function() {
if (isset($_GET['add-to-cart'])) {
$value = $_GET['add-to-cart'];
if (strpos($value, 'gla_') === 0) {
$product_id = (int) substr($value, 4);
$product = wc_get_product($product_id);
if ($product && $product->exists()) {
WC()->cart->add_to_cart($product_id);
} else {
wc_add_notice('Invalid product ID provided.', 'error');
}
}
}
});