You can only merge two partitions that are adjacent, with the free space coming after the partition in a clockwise direction.
In your screen shot, Macintosh HD and Untitled are not adjacent. Macintosh HD is the first partition and Untitled is the last partition with BOOTCAMP in-between. When Apple went to the Pie display, it confused the issue because it looks like first and last partitions are somehow adjacent. They are not.
You cannot do what you want without removing the BOOTCAMP partition with BOOTCAMP Assistant.
If you created that free space from Windows and not BOOTCAMP assistant, you are lucky you Mac partition is still intact.