Because you are using two sets of offsets that is not that this function does! You need to calculate from a static XYZ/RXRYRZ point for this to work.
I tried to calculate position for Crane Cabine, from crane base which is an real object, single "real object" from this crane, but, returns is invalid position, I will try again, probably I used wrong parameters.