In request #41486, we removed the possibility of passing a camelCase name for a data-attribute in favor of passing the full name of the data-attribute (in kebab-case).
Since the getDatasetItemOrThrow now only calls element.getAttribute(), it is no longer limited to data-attributes but can be used for any kind of attribute, really. We should rename it.