Repository: opencv
Issue: Assertion failure when trying to GOut multiple data types. 
Labels: category: g-api / gapi

<!--
If you have a question rather than reporting a bug please go to https://forum.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
- OpenCV => 4.5.1
- Operating System / Platform => macOS Big Sur 11.2.3
- Compiler => Apple Clang & GCC

##### Detailed description

OpenCV assertion check would report assertion failure when trying to return multiple values of different data types (in my case, they are `cv::GArray<cv::GArray<cv::Point>>` and `cv::GArray<cv::Vec4i>`, which are components of contour detection). 

##### Steps to reproduce

```cpp

void ImageProcessWithGapi() {
    std::vector<std::vector<cv::Point>> contours_light, contours_dim;
    std::vector<cv::Vec4i> hierarchy_light, hierarchy_dim;

    cv::GComputation base_pipeline([]() {
        cv::GMat in;

        cv::GMat b, g, r;
        std::tie(b, g, r) = cv::gapi::split3(in);

        cv::GMat threshold_1 = cv::gapi::threshold(b, 200, 255, cv::THRESH_BINARY);
        cv::GMat threshold_2 = cv::gapi::threshold(b, 140, 255, cv::THRESH_BINARY);

        cv::GArray<cv::GArray<cv::Point>> contour_point_1, contour_point_2;
        cv::GArray<cv::Vec4i> hierarchy_1, hierarchy_2;

        std::tie(contour_point_1, hierarchy_1) =
                cv::gapi::findContoursH(threshold_1, cv::RETR_CCOMP, cv::CHAIN_APPROX_NONE);
        std::tie(contour_point_2, hierarchy_2) =
                cv::gapi::findContoursH(threshold_2, cv::RETR_CCOMP, cv::CHAIN_APPROX_NONE);

        return cv::GComputation(cv::GIn(in), cv::GOut(contour_point_1, contour_point_2, hierarchy_1,  hierarchy_2));

    });

    auto pipeline = base_pipeline.compileStreaming();
    auto video_src = cv::gapi::wip::make_src<cv::gapi::wip::GCaptureSource>("/path/to/video/input");
    pipeline.setSource(cv::gin(video_src));
    pipeline.start();

    auto out_vector = cv::gout(contours_light, contours_dim, hierarchy_light, hierarchy_dim);

    while (pipeline.running()) {
            if (!pipeline.pull(std::move(out_vector)))
                break;
    }
}

```

##### Issue submission checklist

 - [-] I report the issue, it's not a question
   <!--
   OpenCV team works with forum.opencv.org, Stack Overflow and other communities
   to discuss problems. Tickets with question without real issue statement will be
   closed.
   -->
 - [-] I checked the problem with documentation, FAQ, open issues,
       forum.opencv.org, Stack Overflow, etc and have not found solution
   <!--
   Places to check:
   * OpenCV documentation: https://docs.opencv.org
   * FAQ page: https://github.com/opencv/opencv/wiki/FAQ
   * OpenCV forum: https://forum.opencv.org
   * OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
   * Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
   -->
 - [-] I updated to latest OpenCV version and the issue is still there
   <!--
   master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
   OpenCV team supports only latest release for each branch.
   The ticket is closed, if the problem is not reproduced with modern version.
   -->
 - [-] There is reproducer code and related data files: videos, images, onnx, etc
   <!--
   The best reproducer -- test case for OpenCV that we can add to the library.
   Recommendations for media files and binary files:
   * Try to reproduce the issue with images and videos in opencv_extra repository
     to reduce attachment size
   * Use PNG for images, if you report some CV related bug, but not image reader
     issue
   * Attach the image as archive to the ticket, if you report some reader issue.
     Image hosting services compress images and it breaks the repro code.
   * Provide ONNX file for some public model or ONNX file with with random weights,
     if you report ONNX parsing or handling issue. Architecture details diagram
     from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
   -->