Unfortunately, the payload that arrives to the broker is the literal string “{“key”: {% anotherentityofmine.state %} }”.
Is there a way to get the actual value of it?
No, payload_on is a string only it does not support templates.
What are you actually trying to do?
If you are trying to make a switch follow the state of the other entity you will have to use an automation and the mqtt publish service, it supports payload_template.