I don’t use user macros that much but the docs say that you should use the entitys ContentProperties instead of using the ContentPropertyManager.
So using the provided $content
variable you could probably just call ContentEntityObject#getProperties and use ContentProperties#setStringProperty on it. After that you should be able to save your modified properties using ContentEntityObject#replaceContentProperties.