Extracts an error message from the response body.
public static
extractErrorMessage(string|array|null $data): ?string