Hey there,
The simple retargeting setup is really only meant for handling bonelength/translational differences. The ref pose is taken into account, specifically the orientation of the joints. If they do not match you will run into the cases you’ve mentioned. , and this is by design as this is generally a much older approach, but is useful for handling simple differences between characters. Animation Relative was added for the case you describe with some trade offs, that being that it won’t take the length delta of the bone directly into account for adjusting the animation and you need to really make sure that the ref pose is very similar proportionally. This is an older video from unreal 4, but it does go over the information and the why pretty well.
https://youtu.be/vZW8mxlQJEk?t=548
If you’re looking to handle more complex scenarios where your character skeleton hierarchy or orientations differ, you will need to explore more advanced IK retargeting.