What data you extract from "monitor_ref"? I guess it is the fields, not the transmission. Fields will change its data dimension when objects changes. Only fixed dimension such as transmission can be extracted.
In addition, optimization is for a scalar FOM. You cannot optimize more than one value of FOM using the built-in particle swarm method.
This is different from the original post. Please write a new post if you have further questions.