Try using double quote instead of single quote (as far as I know single quote does not do variables).
Here’s my working bash script
#!/bin/sh
MY_VOLUME=10
echo $MY_VOLUME
curl "http://localhost:3001/roonApi/change_volume?outputId=1701aa4e166fe64eae164bfae7c5e928181e&volume=$MY_VOLUME"
Hope this helps