That is because the cameras in AE always have perspective. To make the layer disappear you need to calculate the angle to the center of the lens axis. If the layer's anchor point is not exactly on the same axis as the center of the camera the angle will be something other than 90º.
Try this with a real camera. Set a card flat on a table and the only position you can use so the card disappears from view is one where the camera is precisely parallel and lined up with the top of the table.
Thanks for your answer. I'm aware of everything you wrote and I understand that the 3D world in after effects always has perspective. Most of the time, this is exactly what we want. But sometimes it would be cool, to avoid perspective and to rotate a layer by 90 degrees without this "problem".
Maybe anyone out there knows a plugin or a script for that specific need?
That would require someone to rewrite the complete AE 3D render engine, which is out of the question. You have to use 3D-ish plug-ins like Element 3D or Freeform to fake the 3D stuff, but use their built-in 2D/ screen offsets or conventional 2D positioning of the actual layer to get the illusion. Otherwise half of that stuff can be faked by simply scaling layers in 2D and/ or using a bit of simple expression math with effects like Corner Pin.