### Describe the bug, including details regarding any error messages, version, and platform. This is a failure that should have been reported by our ASAN check but is somehow prevented by the problem discussed in #39973 . There is a a living demo in https://github.com/zanmato1984/arrow/actions/runs/7752895694/job/21143188221?pr=3#step:6:3370. One can also reproduce this issue in local by: ``` cmake --preset ninja-debug -DARROW_USE_ASAN=ON -DARROW_JEMALLOC=OFF -DARROW_MIMALLOC=OFF .. ninja -j8 ./debug/arrow-array-test ``` ### Component(s) C++