Variable resolving with syntax error

I'm using the following query for a dynamic range in the where clause, and it seems to be converting it appropriately but still giving me syntax error. Can someone help with this?

SELECT
actions.user_id,
u.website,
YEAR(u.signup_date) AS signup_year,
u.sector,
u.account_status,
COUNT(actions.id) AS total_actions
FROM actions
JOIN users u
ON u.id = actions.user_id
AND u.plan_id NOT IN (100, 200) -- Excluding certain plan types
WHERE DATE(actions.action_date) BETWEEN {{date_range}} -- this resolves rightly, yet syntax err
GROUP BY actions.user_id
ORDER BY u.account_status;

The error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BETWEEN '2023-01-01' AND '2023-12-31' GROUP BY audits.company_id ORDER B' at line 13

you're using aliases and that's not supported, it's on the documentation

The alias is on the table which is not being used for date field filter but even if I remove it from that table, the issue still persists