See
turn 31 and 32 of this game for before and after; the common cards in hand were Spring Wood, Elven sorceress, and Shifting mass, at costs of 1 resource, 3 resources, and 9 resources respectively, but Shifting mass was discarded instead of Elven sorceress.
I took a look at the code block displayed
here, and I don't see anything particularly wrong with it (since get_Resources() probably doesn't get the card's cost in Stock), so the only guess I have is that the shuffle step happens after the card positions are selected for Aria discard, but before the actual discard, and then the code to correct for when the cards move fails when the card for the new position and old position share a cost for a single resource type? (Gems, in this case.)
(I also checked the other Whirlwind bug, and this is not that.)