Applying a specific pose rotation with custom anim node

I’m writing this in case there are people who have similar problems as me.
Luckily my approach worked! The reason my character’s fingers rotated in a different direction than expected was because I put yaw in place of roll when getting the rotation of the finger bones.
The above approach and logic worked fine!