It is, of course, hard to give specific advice without proper context. I tend to agree with Victor on the options you listed. I might suggest you investigate other response variables. It really helps to know what mechanisms you are investigating.
Since X is a component of Y, and Z = X/Y is derived from both, I would be hesitant to optimize all three directly. I’d first ask whether there is a more fundamental response that represents the actual objective. For example, is the goal to increase the amount of desired component, reduce the undesired component, improve selectivity, or improve conversion efficiency?
I’d also be careful with the ratio. Ratios can become unstable, especially if Y varies substantially or gets small. The ratio may exaggerate noise in either X or Y. A graph of predicted X versus predicted Z, or X versus Y with purity contours, may be more informative than simply optimizing a desirability function.
"All models are wrong, some are useful" G.E.P. Box