Relationship created by API does not add Membership until edited/updated
I wouldn't use the setvalue method, it was introduced as a stop gap measure when the api v3 was young and it's deprecated now.

Is the relationship already active when you call the create call? setvalue isn't going to do anything more anyway.

I don't know the specific of that api, but in general, the api calls tend to be "close to the metal" and if there is a chain of events (eg if relationship is created and lots of configuration magic, then add a membership too), they are often not included by default.

On your specific case, if you are lucky it's just a matter of finding the right parameter to trigger the "advanced mode", or create the membership manually.

You should check out how it's done in the code for the UI, the code handling the membership creation might be already into the BAO layer and you can easily modify (or add an extra param) to the api to benefit from it.

If not, it might need some re-factoring....