

It’s not grammatically incorrect to end a sentence with a preposition. It’s a common misconception that it is a rule, basically because one guy argued in favor of it back in the 1600s and had some support for formal writing in the 1700s. But it’s never been a broad rule, and even in formal contexts it’s not a rule in any current, reputable style or usage guides (so far as I know, at least).
Some more info on the topic: https://www.merriam-webster.com/grammar/prepositions-ending-a-sentence-with
I hate how much I agree with you in principle and how ugly it looks in practice. With doubled periods, at least - different marks don’t trigger that same reaction. For example, a question mark inside, followed by a period or comma outside feels right.