No doubt frame material and frame design can have an impact on how much the noise is amplified but I wonder if the design of the rear triangle also has an input and is the reason why some bikes are quieter than others. My wife has the 2020 motor in a Cube Access which is a hardtail and it makes not rattling noise at all. For the same reason it could be that a rear shock set differently in terms of compression or progression ( most probably just beyond the sag point or at the midstroke) may also determine whether suspension movement agitates the chainwheel via the chain.
its the chain growth as the suspension compresses and extends that tugs on the chainring and makes the clattering noises inside the motor, a bike with no chain growth (eg a hardtail) will be a lot quieter than a bike with a lot of chaingrowth.