Repository: opencv
Issue: G-API error in some PatternMatchingIntegrationE2E tests
Labels: bug,platform: arm,category: g-api / gapi

### System Information

OpenCV version: 4.x
OS: Android 14
Device: Google Pixel 8
Compiler: CLang

### Detailed description

These tests fail, see the log below:
* `PatternMatchingIntegrationE2E.ChainTransformationsApplied`
* `PatternMatchingIntegrationE2E.ReversedChainTransformationsApplied`
<details>
<summary>Log</summary>

```
CTEST_FULL_OUTPUT
OpenCV version: 4.10.0-dev
OpenCV VCS version: 4.9.0-551-g1363b7813d-dirty
Build type: Debug
Compiler: /home/savuor/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++  (ver 14.0.6)
[ INFO:0@0.965] global registry_parallel.impl.hpp:96 ParallelBackendRegistry core(parallel): Enabled backends(2, sorted by priority): TBB(1000); OPENMP(990)
[ INFO:0@0.965] global parallel_for.tbb.hpp:54 ParallelForBackend Initializing TBB parallel backend: TBB_INTERFACE_VERSION=12110
[ INFO:0@0.965] global parallel.cpp:77 createParallelForAPI core(parallel): using backend: TBB (priority=1000)
Parallel framework: tbb (nthreads=9)
CPU features: NEON FP16 *NEON_DOTPROD *NEON_FP16 *NEON_BF16?
TEST: Skip tests with tags: 'mem_6gb', 'verylong', 'debug_verylong'
Note: Google Test filter = *ChainTransformationsApplied*
[==========] Running 2 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 2 tests from PatternMatchingIntegrationE2E
[ RUN      ] PatternMatchingIntegrationE2E.ChainTransformationsApplied
[ INFO:0@1.002] global kernels.cpp:258 expandKernels Final graph: 8 nodes

[ INFO:0@1.005] global gcompiler.cpp:416 runPasses All compiler passes are successful
[ INFO:0@1.051] global kernels.cpp:258 expandKernels Final graph: 6 nodes

[ INFO:0@1.053] global gcompiler.cpp:416 runPasses All compiler passes are successful
AbsExact error: G-API output and reference output matrixes are not bitexact equal.
/home/savuor/ocv/4.x/opencv/modules/gapi/test/internal/gapi_int_perform_substitution_test.cpp:461: Failure
Value of: AbsExact()(orig_graph_output, transformed_graph_output)
  Actual: false
Expected: true
[  FAILED  ] PatternMatchingIntegrationE2E.ChainTransformationsApplied (115 ms)
[ RUN      ] PatternMatchingIntegrationE2E.ReversedChainTransformationsApplied
[ INFO:0@1.111] global kernels.cpp:258 expandKernels Final graph: 8 nodes

[ INFO:0@1.114] global gcompiler.cpp:416 runPasses All compiler passes are successful
[ INFO:0@1.157] global kernels.cpp:258 expandKernels Final graph: 6 nodes

[ INFO:0@1.159] global gcompiler.cpp:416 runPasses All compiler passes are successful
AbsExact error: G-API output and reference output matrixes are not bitexact equal.
/home/savuor/ocv/4.x/opencv/modules/gapi/test/internal/gapi_int_perform_substitution_test.cpp:461: Failure
Value of: AbsExact()(orig_graph_output, transformed_graph_output)
  Actual: false
Expected: true
[  FAILED  ] PatternMatchingIntegrationE2E.ReversedChainTransformationsApplied (107 ms)
[----------] 2 tests from PatternMatchingIntegrationE2E (222 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test case ran. (224 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] PatternMatchingIntegrationE2E.ChainTransformationsApplied
[  FAILED  ] PatternMatchingIntegrationE2E.ReversedChainTransformationsApplied
```
</details>

### Steps to reproduce

See [this instruction in OpenCV Wiki](https://github.com/opencv/opencv/wiki/Running-native-OpenCV-code-with-Hardware-Address-Sanitizer)
Run test:
```
LD_PRELOAD=/data/local/tmp/libc++_shared.so ./opencv_test_gapi --gtest_filter=*ChainTransformationsApplied*
```
Probably can be reproduced w/o HWASan

### Issue submission checklist

- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files (videos, images, onnx, etc)