Solving bootcamp error message to erase windows partition
This is a very common question. Again, here is the commands you need to enter in a Terminal application window.

The next two commands will remove the disk0s4 partition and the disk0s3 partition labeled BOOTCAMP 

sudo diskutil eraseVolume free none disk0s4
sudo diskutil eraseVolume free none disk0s3


The next command return the free space back to the disk0s2 APFS container partition.

sudo diskutil apfs resizeContainer disk0s2 0


There may still be Windows boot files stored in the hidden EFI partition (disk0s1). These files can be removed by entering the commands given below.

sudo diskutil mount disk0s1
cd /Volumes/EFI/EFI
rm -r Boot
rm -r Microsoft
cd ~
diskutil unmount disk0s1