The problem has apparently been fixed in some update to R2024a. This is a revert of commit 18131492. (cherry picked from commit 1d5f79c8)