If possible, try creating a debug.log file on your WordPress server and then writing to that file from your rcpdc_add_member_to_group function. You can use that to make sure that the function is getting called and for checking that the correct values are being assigned to the variables you are creating.
For debugging, I usually use the approach that is described here: Debugging in WordPress – Advanced Administration Handbook | Developer.WordPress.org. You need to manually create the debug.log file and add it to your wp-content directory.