You need either an ungroup() after the summarise or a .groups = "drop" in the summarise.
You should have received a warning alerting you that the output is still grouped.
`summarise()` has grouped output by 'am'. You can override using the `.groups` argument.