"Specific Date" filter doesn't work

Hello, I have a rather complex query with a date filter (see below) when I select one of the preset date range like "Previous month", "Last 7 days"... it works but when I try to select a specific date range with the button "specific date" it loads infinetley :

the query:
WITH nb_events AS (
SELECT
user_id,
COUNT(DISTINCT (CASE WHEN event_type in ('create-uwcase', 'update-building-facet','uwa-activity-search') THEN uwcaseid ELSE id END)) AS nb,
env
FROM
events_with_users_info
WHERE
{{date}}
AND actif_attendu ='Actif Attendu'
AND {{type_evenement}} and env not in ('beta','master','demo') and {{events_with_users_info.env}} and {{caisse}}
AND event_category != 'USER' and account_type_corrected not in ('None','Internal')
GROUP BY
user_id,
env
),

nb_crea AS (
SELECT
user_id,
COUNT(DISTINCT (CASE WHEN event_type in ('create-uwcase', 'update-building-facet') THEN uwcaseid ELSE id END)) AS nbcrea,
DATE_TRUNC('week', date) AS week_start,
env
FROM
events_with_users_info
WHERE
{{date}} and {{events_with_users_info.env}} and {{caisse}}
AND actif_attendu ='Actif Attendu'
AND {{type_evenement}} and event_type in ('create-uwcase','fetch-uwcase')
AND event_category != 'USER' and account_type_corrected not in ('None','Internal') and env not in ('beta','master','demo')
GROUP BY
user_id,
week_start,
env
),

avg_nb_crea as (
SELECT
user_id,
AVG(nbcrea) AS avg_nbcrea_per_week,
env
FROM
nb_crea
GROUP BY
user_id,
env),

activite as (select user_id, env, count( distinct TO_CHAR(date, 'DD/MM/YYYY')) AS nbjourco
from events_with_users_info
where event_category != 'USER' and actif_attendu='Actif Attendu' and {{date}} and {{events_with_users_info.env}} and {{caisse}} and env not in ('beta','master','demo')
group by user_id, env ),

jour AS (
SELECT
events_with_users_info.user_id,
COUNT(DISTINCT TO_CHAR(events_with_users_info.date, 'DD/MM/YYYY')) AS jours_travaille
FROM
events_with_users_info
JOIN
(SELECT user_id, MIN(date) AS onboarding_date FROM events_with_users_info GROUP BY user_id) eu
ON
events_with_users_info.user_id = eu.user_id
WHERE
EXTRACT(DOW FROM events_with_users_info.date) BETWEEN 1 AND 5 -- Exclure le samedi (6) et le dimanche (0)
AND events_with_users_info.date >= eu.onboarding_date and {{date}}
GROUP BY
events_with_users_info.user_id
)

SELECT
DISTINCT events_with_users_info.user_id, events_with_users_info.account_type_corrected,
events_with_users_info.env,
COALESCE(nb, 0) AS nb,
COUNT(DISTINCT CASE WHEN events_with_users_info.event_type = 'create-uwcase' and {{date}} THEN events_with_users_info.uwcaseid END) AS uwcase,
COUNT(DISTINCT CASE WHEN events_with_users_info.event_type = 'fetch-uwcase' and {{date}} THEN events_with_users_info.id END) AS fetch,
COUNT(DISTINCT CASE WHEN events_with_users_info.event_type = 'generate-uwcase-pdf' and {{date}} THEN events_with_users_info.id END) AS pdf,
COALESCE(CAST(nbjourco as float)/CAST(jours_travaille as FLOAT), 0) as ratiotravail,
CASE
WHEN COALESCE(avg_nbcrea_per_week, 0) > 15 THEN 'super-utilisateur'
WHEN COALESCE(avg_nbcrea_per_week, 0) <= 15 AND COALESCE(avg_nbcrea_per_week, 0) > 5 THEN 'réguliers'
WHEN COALESCE(avg_nbcrea_per_week, 0) <= 5 AND COALESCE(avg_nbcrea_per_week, 0) >= 1 THEN 'irréguliers'
ELSE 'inactif'
END AS type_user,
CAST(MIN(date) AS DATE) as date_onboarding
FROM
events_with_users_info
LEFT JOIN
nb_events ON events_with_users_info.user_id = nb_events.user_id
LEFT JOIN
avg_nb_crea ON events_with_users_info.user_id = avg_nb_crea.user_id
left join
activite on events_with_users_info.user_id = activite.user_id
left join
jour on events_with_users_info.user_id = jour.user_id
WHERE
{{events_with_users_info.env}} and {{caisse}}
AND actif_attendu='Actif Attendu' and events_with_users_info.env not in ('beta','master','demo')
AND events_with_users_info.user_status = 'external' and events_with_users_info.account_type_corrected not in ('None','Internal')
GROUP BY
events_with_users_info.user_id,
events_with_users_info.env,
nb, nbjourco, account_type_corrected, jours_travaille, avg_nbcrea_per_week
ORDER BY
nb DESC;

can you specify which version this is? and also, what is the query being built by Metabase with an explain analyze so we can see the query planner output?

Yes here is the output :

and we are on v1.49.17