Prevent newer versions of SQL from building or executing

Solution for Prevent newer versions of SQL from building or executing
is Given Below:

My laptop is running SQL Server 2019, but my server is running an older version.

Is there a way I can configure my laptop database such that I can use SQL Server 2019, but have it fail to execute or compile SQL that is newer than a specific version, without installing two separate instances of SQL Server?

I.e. I would like to configure my database such that if STRING_AGG is executed, it will fail because I have set my database into something like a SQL Server 2016 mode.

Or any plugins that do this?