Layers can only be replaced when the input and output dimensions are same.
And unless I am mistaken the layers in ResNet are present as layer blocks not individually. So either you must replace an entire block of them.
Anyway I think it’s better to replace the nodes near the end as they are more likely to carry less information in their weights. And the dense layers at they end. Those shouldn’t give any trouble.
Just be careful with dimensions and you should be fine I think.
Take a preview of the model by viewing it’s repr before trying anything.