oh i am late with my file / answer…
martinsiegrist already pointed out the most important aspects:
- build proper curves (interal G1 oder G2 )
- split surfaces to remove self-intersection
my approach is not to use Sweep:
- just build 2 proper curves, recommended : Degree 5, 16 points
- loft for top surfaces
- extrude for flange
- split at knots (shrink = yes) to remove self- intersections
- trim, join
- filletEdge