**Describe what's wrong**
Request with `DISTINCT`+`LIMIT BY`+`LIMIT` return less rows than provided in `LIMIT`

**Does it reproduce on recent release?**
22.11

**How to reproduce**
The following query from hits table returns less number of rows then provided in LIMIT
```
SELECT DISTINCT
    Title,
    SearchPhrase
FROM hits_v1
WHERE (SearchPhrase != '') AND (NOT match(Title, '[а-яА-ЯёЁ]')) AND (NOT match(SearchPhrase, '[а-яА-ЯёЁ]'))
LIMIT 1 BY
    Title,
    SearchPhrase
LIMIT 10
````
**Expected behavior**
Query returns number of rows provided in `LIMIT`

throw Exception("Query with after aggregation stage cannot have any other stages", ErrorCodes::LOGICAL_ERROR);
        }
        if (expressions.first_stage)
        {
            
            
            if (!query_info.projection && expressions.filter_info)
            {
                auto row_level_security_step = std::make_unique<FilterStep>(
                    query_plan.getCurrentDataStream(),
                    expressions.filter_info->actions,
                    expressions.filter_info->column_name,
                    expressions.filter_info->do_remove_column);
                row_level_security_step->setStepDescription("Row-level security filter");
                query_plan.addStep(std::move(row_level_security_step));
            }
            if (additional_filter_info)
            {
                auto additional_filter_step = std::make_unique<FilterStep>(
                    query_plan.getCurrentDataStream(),
                    additional_filter_info->actions,
                    additional_filter_info->column_name,
                    additional_filter_info->do_remove_column);
                additional_filter_step->setStepDescription("Additional filter");
                query_plan.addStep(std::move(additional_filter_step));
            }
            if (expressions.before_array_join)
            {
                QueryPlanStepPtr before_array_join_step
                    = std::make_unique<ExpressionStep>(query_plan.getCurrentDataStream(), expressions.before_array_join);