When you lose your password to an account, how do you reset it? With your email (in the case of Yahoo, with your backup email). Which, if someone has your unlocked phone, is likely already compromised as part of the unlocked phone.
Sending an OTP via SMS doesn't really open up any new avenues of attack, if they already have your unlocked phone.
Now then, if you're displaying all text messages via lock screen, why have a lock screen at all? Sure, it protects the rest of your phone from intrusion, but it's leaking what should be considered private information to anyone who has it. You're probably also getting email summaries, chat summaries, and upcoming meetings as well.