Teleport entity to it's own X and Z but the player's Y value?

Solution 1:

Since you only want to move non-player entities, you can simply copy your Y coordinate to theirs in NBT:

/execute store result entity @e[type=item,limit=1] Pos[1] double 1 run data get entity @s Pos[1]

But that rounds down to the bottom of the block you're in, so for example the entity would fall through slabs if you are standing on slabs. You can increase the accuracy by scaling up when reading from NBT and scaling down when writing into NBT. Currently (1.15.2) all block heights are in steps of 1/32 of a block (archive). And if you're not standing on a block, then rounding down 1/32 shouldn't matter anyway. Using 64 as a scale factor gives you even better accuracy:

/execute store result entity @e[type=item,limit=1] Pos[1] double .015625 run data get entity @s Pos[1] 64

You will also not get any overflow issues with this scale factor, because if you were above y=33554432 for some reason, you would get kicked anyway.