Let's say we have three courses: A, B and C. Also, course A is a metacourse aggregating B and C.
Then, i go to course B and enroll a user with any role, marking it as a hidden assign. If i go to course A, the assign o that user will not be hidden.
I have tracked it down to the sync_metacourse() function, when this function gets the assignments of users in child courses, it doesn't get the hidden field from role_assignments and so, it is not passed as parameter to role_assign() afterwards.
So, unless this should not be done for some reason, i am willing to do the patch to correct this.