That’s absolutely fine, sorry for the lack of MWE.
Indeed, get_tmp_cache is exactly what I need! And its existence implies that it’s not safe to make your own temporary arrays. I can look into the code and figure out why so I’m all set. Thanks for the tip!