I have a polygon vector layer with overlapping features (like below) and I would like to convert the features that are fully contained inside the bigger polygons (ie feature 2 and 4 below) into inner rings. I have tried saving the inner ring features as a separate polygon layer (they are all identified by attribute value) and using these as a difference layer in QGIS to no avail (I get a geometry error and result is only those features that were not intersecting). There a number of similar looking questions on here but I have not found any where the polygon vector layer contains distinct features to be made into inner rings.
Is there any way to just set those features as rings? I know I could digitise the rings but I need to do this for many many features and a more general programmatic solution would be much appreciated...