Hi how, welcome to the forum!
When there are a different number of segments between 2 curves that you are lofting, Loft just doesn't really know how to do anything other than a kind of global averaging process which you're seeing there in the result you don't want.
When that happens, the solution is to use Edit/Separate to break your curves down into individual segments and do the Loft between individual pairs of segments so you can control how things are getting matched up.
So for example in this case, use Edit/Separate and then do the Loft with just these 2 curves:
That will produce a result like this:
Repeat that on the other 3 similar pairs (so using Loft 4 individual times) to get this result:
That has now got one portion of your desired result built. Now to do the corner pieces, there are a couple of different ways but I would do it by drawing a line here:
Now select these 3 curves (to select the edge of the surface, select the surface first and then with a second click you can "drill in" to select the edge):
And then run Construct/Planar to build a planar surface there:
You can then repeat that with the other triangle pieces to build all the corners, and also the bottom square cap can be filled in that way as well.
Once you have all those surfaces created, then it is a good idea to select them all, and run Edit/Join to join them into one connected solid object. You'll want to have surfaces joined when you export to a mesh - joined edges get handled specially to be sure to get a common vertex structure on shared edges to avoid any cracks. When you have separate unjoined surfaces, it is possible for them to get meshed independently and have slightly different mesh structures which can make little tiny cracks in there, so make sure to join surfaces up to avoid that.
I hope this helps! Let me know if you have any more questions,
- Michael