I think is the following: In the function the setting mdp_global_categories_taxonomies was set somehow even though i never set it. I test putting a return at the beginning of the function and it worked.
I think it is set even if it is not displayed. So I made a little test: I chose restrict to master site, turn off the global categories, then change again to no restriction. And it worked.