If anyone else finds this issue, the solution was to wrap the returnd bytes_ in a BytesIO buffer.
bytes_
BytesIO