When my phone was updated to Android 9, that toggle became force-portrait. If I enable it now, it immediately turns back to portrait and disables rotation.
I just did it on an iphone 6S Plus and an iPhone XS both with ios13+, and while in landscape, if I press lock rotation, it changes to portrait and then locks it.
I’ve experienced this since iPhone 3G or iPhone 4, so I assume this is how they have designed it.