Middle Earth is not canonically flat for elves. It’s round, except if elves sail away to the Undying Lands they can sail in a straight line, and men just sail around the globe. So it’s more like a sphere with a weird ocean tangent I guess, or maybe there’s a secret portal or something.
That being said, Tolkien wrote a lot, so if you want to argue that Middle Earth is flat for elves, it probably says that somewhere.