MacOS: unable to resize partitions after bootcamp failed
I somehow managed to do it. First, I reformatted all small hidden partitions from disk0s4 to disk0s8 using this command:

diskutil erasevolume JHFS+ data5 disk0s4


Then I merged all those partitions using this command:

diskutil mergePartitions JHFS+ BOOTCAMP disk0s4 disk0s8


Finally I used the visual disk utility app to remove the newly created BOOTCAMP partition, which then gave all the empty space to my MacOS partition.