How to remove a container disk and reclaim space with main partition (similar to another question)
The safest way would be to use macOS Recovery. Reboot and hold down ⌘+R key combination until the Mac boots to macOS Recovery. Open a Terminal application window and enter the following commands.

gpt -f remove -i 3 disk0
diskutil apfs resizecontainer disk0s2 0


An alternative quicker method would be to open a Terminal application window in macOS and enter the following commands.

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