Flat in 4 dimensions (3 dimensions of space and one dimension of time) should imply that gravitationally the universe is expanding fast enough that gravity just can’t slow it down to recollapse, but only barely.
But as long as we’re talking about magic walls, imagine one on one side of the universe that if you fly through you end up on the other side of the universe seamlessly.
Let’s take your piece of metal. If you’re living on that 2 dimensional sheet, you see everything as flat.
If the sheet were rolled into a tube, but the tube were really large, any local region would appear totally flat.
Now, connect the ends of the tube. If the tube’s large enough, any local region would appear totally flat.
So all that we can say about making any sort of measurement directly on space is that it might appear to be locally flat.
However, the gravitational expansion of the universe might be within the topology that exists and overall independant of it. This describes the growth of the sheet.
Its the curvature of this growth rate over time that determines the ‘closed’ ness of the universe in terms of whether we will end up in a big crunch.
So the doughnut grows or shrinks. At this point, the doughnut might be so large that everything is physically, in 3 dimensions, flat. But the universe could still be, over time, closed (it will collapse down into a teeny doughnut), or open (it will be forever growing as a massive doughnut), or just on the cusp.
In all cases its still a doughnut, and locally will always appear basically flat.
But there’s hints we can see some of the non-flatness at a truly massive scale.
Regardless, none of this changes the possibility that the universe is topologically nontrivial, and this dodges the notion of requiring a magic wall.