Hello,
The getWordStyles metod return styles used by contents, but its structure can't used directly with WordFragments, you'd need to parse the styles and generate and array with the styles to be applied.
The recommended approach to autodetect and apply the existing styles in a placeholder when replacing it by a WordFragment is using a Premium license with the stylesReplacementType option.
Regards.