Horizontal = you're in apartment 4B. You try 4A's key. It opens. Same floor, neighbor's door.
Vertical = you're a tenant. You try the building manager's key. It opens. Different floor, different authority entirely.
In both cases the API made the same mistake — it didn't check ownership or role when an ID was supplied. The only difference is whose data ended up exposed.