Setting the categories to which a parameter definition will be bound

Hey everybody,
I am trying to set the categories to which a parameter can have a value , ie these:

For testing purposes I created two parameters, a shared one and a standard project one:
Both are temporarily assigned to only one category:

I then tried running this script:

import clr
from System.Collections.Generic import *
from Autodesk.Revit.DB import *
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

params = UnwrapElement(IN[0])

TransactionManager.Instance.EnsureInTransaction(doc) #necessary?
bindings = doc.ParameterBindings

#Create a Categoryset containing all model categories
modcats=sorted([i for i in doc.Settings.Categories if i.AllowsBoundParameters])
for cat in modcats:

#Modify and update parameters
for param in params:
	paramdef = param.GetDefinition()
	item = bindings.Item[paramdef]

doc.Regenerate() #necessary?

OUT = 0

On the shared parameter it works with no problems:

But on the project parameter it does nothing and no errors appear. If i read the binding’s Categories with python it shows me all of them, but in the Revit UI I can’t see any change (neither in elements or in the project parameter window)

It’s like as if the binding won’t update completely. What else could I try other than bindings.ReInsert , doc.Regenerate, transactions…?