Anomaly inflow for gauge defects