Hm out of curiosity I tried and it gave me some error about the file not having an associated application. The extra strange thing is I do indeed have json files associated with Visual Studio code.
Ok I might have discovered something. Originally my JSON file type entry had the name set as something like "Adobe After Effects JSON". But I renamed it to just "JSON" and now the same command seems to work
Also now works if I rename it to something else like "JSON Test":
So maybe try just renaming the file type description?
Edit: Another thing I just checked is that in the registry under HKEY Classes Root, it seems that the .json key has its (Default) value set to something After Effects related. So I wonder if maybe some other application has "hijacked" the association somehow. I'm not really sure how file associations work at this level in Windows, especially since again I don't even have json files associated with After Effects, it must be something AE did itself.
Another Edit:
I tried using the Export feature and while it didn't include the JSON file type's current entry and settings, it did show a duplicate copy entry of the JSON type I had made before as a test, which does indeed show the same string that's in the registry. So it must have pulled the value that After Effects set at some point which might be confusing it.
I tried renaming the description (before it was "JSON File") to "JSON", but when I right click and click on Test, it gives me the same error as before.
Then I tried deleting the .json registry entry on HKEY Classes Root. The actions I created before on Directory Opus were gone, and even the File Types window in Directory Opus didn't show any json entry (as expected). Then I manually created a JSON entry as following:
In any case seems like maybe it's a different problem altogether.
Side note though seeing the default value does shed light on why the other error was happening on my system. I guess After Effects "redirected" the .json extension to some new filetype it called Adobe.AfterEffects.json.24: