Extruding square shape (from mesh) along curve results in a flattened mesh
The problem is your object called "square". It does not have the same orientation as the "Cylinder.001" that you used to extrude the Cylinder. The curve will be extruded on the local Z axis so make sure its facing the direction of extrusion.
A quick fix is to open the object "square" in Edit Mode and rotate it on the Y axis by 90°.