Random poly lines consists of vertical and horizontal and angle 45 lines

I have a set of tweened curves that were extracted from two curves and i am trying to create random closed polylines as in the following figure

The dotted black line i am looking for another way to automate it rather than creating in manually I thought about splitting the curves at random points and chamfering it I don’t know this is the reference picture