If you view the API documentation at https://doc.wikimedia.org/Wikibase/master/js/rest-api/ you'll note that it only allows you to use https://wikibase.example/w/rest.php/wikibase/v0/ as the server in all its examples. This means that all of the inline examples don't work, because that's not a real API endpoint.
It'd be better if we defaulted it to something like https://test.wikidata.org/w/rest.php/wikibase/v0/ which will at least allow the on-page examples to run.
This ticket brought to you by: me having to help someone who was confused about why none of the examples worked. 😅