You mentioned in an earlier post that you “…want to maximize the reaction force using direct optimization by giving material type as an input”
Since your material type assignment would be a fixed integer with a limited number of combinations, can you use WB-Parameter Manager to arrive at the Design Point that gives you max force (as an output parameter).

This should preserve your contact settings.