This example is solved by z3 4.12.1, but not by later versions. The regression was introduced in commit 0758c93, which fixed issue #6591 (I reverted this commit locally, and now it works).
However, this issue was about quantifiers, whereas my example is quantifier free. Can the old behavior be restored for quantifier free instances?