Replace Block Problem

I have a few blocks. When I try to replace them with a new block the orientation gets changed.

For example, when I try to replace the yellow marked block with the black color block, the orientation gets changed.
image

The block gets rotated like the following picture
image
I have attached the file herwith too.
p.3dm (66.8 KB)

dear Na Maruf
the reason is, that your block-definitions do not match regarding insert-point and orientation of the L:
If i insert both Blocks at the origin i end up with this:

hope that helps - best -tom

(A) you have to redefine your block-instances, so they both match regarding insert-point and orientation.
insert both blocks at the same position as a test - they have to match the behaviour you want.

(B) If you insist on a “solution” - which is more a workaround for a mistake - you can define a nested block, (a block inside a block) that corrects the orientation / insert-Point.