Raise an error if the result is not a `dict`