What this transform_entities() error means

I tried to apply transformation method to array of entities and got this error
#<ArgumentError: All Entities must have a common parent>

Please repost your error message, preceding and following it with lines containing three backtick characters ( ` not apostrophe or single quote). That will prevent the forum software from trying to process your message as markdown and therefore “disappearing” anything surrounded by angle brackets.