These six nodes are necessary for this:

You would only have to convert the ends of your base curve into two points with Curve to Points, and instantiate your profile curves at these points, which you have previously converted into a mesh with Fill Curve.
However, in exactly such a use case you still have the problem of the normals of the faces that lie inside the shape and the missing UVs.
You would have to correct them manually (depending on the result you want) with Reverse Curve before or Flip Faces after.
For example, you can solve this task as follows:

By reversing the inner profile curve with Reverse Curve, Curve to Mesh creates the inner faces with correct normals. You then convert these profiles into instances in two variants: once normal, and once with Flip Faces. Finally you would have to activate Pick Instance in the node Instance on Points, which in this case selects one of the two meshes at the beginning and end.
Self-advertising: You can also solve the issue with the missing UV and intersecting profiles professionally with a specially built node group that can handle any kind of intersection, even correcting the normals of newly created faces: Curve to Mesh UV