Runtime Dynamic Property Restrictions

You cannot:

Changing runtime dynamic properties and clusters of a class in the same transaction in which an instance of the class is created can result in exception 3158 (Partition method execution failed) being raised on the server in multiuser mode, if the database file is partitioned and the class is not open.

You should use one transaction to change runtime dynamic property metadata and a separate transaction for object updates.