Passing variable as parameter to json_query function
It is possible in SQL Server 2017.

From JSON_QUERY (Transact-SQL)


  In SQL Server 2017 and in Azure SQL Database, you can provide a
  variable as the value of path.


In SQL Server 2016 you have to build the query dynamically.