[WIP] Adds failing test for select/each issue

Related to #9436