Oh, I didn't read this thread before, but I found https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/333#note_44607 which I think counts as "code that performs an invalid cast".
Right, I meant we don't have any such code currently in Wine. This patch would introduce some.