How to get rid of artifacts in corners - Bevel Object
Moving your Bezier Curve's origin (that you use as your Bevel Object) to the "outside" of your Curve will solve your problem:


Your Origin is now "in the middle of" your Bezier Curve so that your Bevel Object can't be moved along your rectangular path without these artifacts.