Sweep problem at corners

I am trying to sweep a simple rectangle at the polyline but it is not running at corners. any ideas to make it one brep at corners
sweep test.gh (5.7 KB)
weep at corners as well .

regards


sweep test_revA.gh (5.3 KB)