It seems this sentence is using “replace A with B”. Then, can I also use “replace someone with someone”?

Native speaker’s answer
Rebecca
Yes, you are able to substitute objects or people by using "replace A with B". Ex. A player was injured, so the coach replaced the batter with a substitute player. Ex. I didn't have enough baking ingredients at home, so I replaced eggs with mashed banana.