Rebar.SetlayoutAsMaximumSpacing doesn't work on revit 22~25

seem the package is outdated

Try doing this in Python or another package.

or