I just went through your definition. It is using one curve only for all the courses of the bricks stacked over one another.
In my script, I am using a curved surface then splitting it into many curves. Then those curves are being used to make courses of the bricks. Since every curve is slightly different from the other one, it is resulting in bricks colliding into each other on every course as we move upwards.
I think you have to decide first what you exactly want. Since the curves vary in length something needs to be done to accommodate each row. This can be varying brick lengths, gap lengths or # of bricks. For sharper corners you might even need trapezium shaped bricks.