How to remove a container disk and reclaim space with main partition?
Here, I assume the macOS volume that you boot to is Macintosh HD.

The commands below should remove the extra partitions and return the free space back to macOS.

 diskutil erasevolume free none disk0s4 
 diskutil apfs deletecontainer disk0s3
 diskutil erasevolume free none disk0s3
 diskutil apfs resizecontainer disk0s2 0