| themightyjello |
The spell also calls out animated objects, retrievers, and shield guardians which do not have immunity to magic or spell resistance. That part is obviously working as intended.
As for golems? They are immune to it RAW because it allows spell resistance, so it just does not work as (obviously) intended unless an errata is released.
Golems do have special exceptions to their spell immunity based on the type of golem but seeing as this spell does not explicitly call that out (whether an oversight or not) as written it would not affect any type of golem that has the magic immunity trait.
Since Golems cannot voluntarily lower their magic immunity like creatures can do with spell resistance it wouldn't even be possible to use that as a workaround. Without some way to negate the magic immunity, this spell simply does not work on golems.