**Describe the bug**
When the requests are done in a very specific environment, they got an error from ClickHouse. The partially it was fixed in https://github.com/ClickHouse/ClickHouse/pull/21936

**Does it reproduce on recent release?**
It's reproducible with docker image `yandex/clickhouse-server:latest` having digest `sha256:d359e6cff39486d2563cd16a307e0981ea6150760d7589b35e0e76ee7ba889ce`

**How to reproduce**
The very precise case for reproduction is present in https://github.com/Felixoid/ch-forms-issue

**Expected behavior**
The requests should work
{
    if (!checkpoint)
        throw DB::Exception("There is no checkpoint", ErrorCodes::LOGICAL_ERROR);
    checkStateCorrect();
    if (!checkpointInOwnMemory() || currentlyReadFromOwnMemory())
        return;     
    size_t bytes_to_append = pos - sub_buf.position();
    resizeOwnMemoryIfNecessary(bytes_to_append);
    memcpy(memory.data() + peeked_size, sub_buf.position(), bytes_to_append);
    sub_buf.position() = pos;
    peeked_size += bytes_to_append;
    BufferBase::set(memory.data(), peeked_size, peeked_size);
}
PeekableReadBuffer::~PeekableReadBuffer()
{
    if (!currentlyReadFromOwnMemory())
        sub_buf.position() = pos;
}
bool PeekableReadBuffer::hasUnreadData() const
{
    return peeked_size && pos != memory.data() + peeked_size;
}
}