I like Bergman a lot and I think there is some of that self-loathing in the work but I’d say a vast majority of his filmography has nothing to do with it and I’m not sure he ever really shed some of those politics
If most of Bergman’s entire filmography is a once Nazi-sympathizer grappling with decades of self-pitying realization that he, and all like him, should have probably been shot, then Shame (1968) is that energy quite literally detonated into its most projected self-loathing.