Yes you can walk, but it means going landside and so going through security again. If you don’t want to do that’ you can take the airside shuttle bus. Walking will be quicker (10 min).
On the way back, it doesn’t matter as you have to go through security in CDG arriving from non-Schengen and connecting to Schengen. Again, walking will be quicker