I once had a keyboard app that also copied OTPs automatically, could've been GBoard, it doesn't seem like a universal feature since SwiftKey doesn't have it in my case.
Edit: I misunderstood your comment, most apps that I use that send out codes do log them in automatically if they're open, so I have to manually copy a code only if I'm on a website.
I tried a Flip 4 but it had way too many compromises for my taste relative to a regular samsung phone in the same price range, I was also concerned about it's durability as I tend to keep my phones for about 3 years.