I agree. I think the issue is with the demo site's ability to call the tool endpoint. I'm not sure how the demo site's configured but it could be a connectivity issue. Moodle has a bunch of setting controlling this, but mainly under http security in site admin. It's falling over when it's trying to pass the keyset array (parsed from the JSON it got at the endpoint) to another method. At that point, it should not be empty, since we've just fetched it, but it is.
Rather than continue trying to track this down on the demo site, I'd suggest just running a local Moodle to rule this out. Then you control everything and won't be subject to whatever someone else may have done at site admin, as you are on the demo site.
Edit: and nope, that JWKS looks fine to me.
by Jake Dallimore.