When you throw an ender pearl and it lands on a wall with two glass blocks below or it hits the glass you will teleport into the wall and take suffocation damage. I included a YouTube video link I created below that demonstrates what is happening and how this can be recreated.
Same thing happens on Nintendo Switch as well