The PSU also supplies 9V AC (this is not a mistake). The C64 is quite sensitive to over-voltage, so your switching supply might work, or it might kill it because there are voltage spikes which modern equipment doesn't care about, but the C64 will.
The PSU situation isn't great: building your own is difficult (see https://www.c64-wiki.com/wiki/Power_Supply), and using an old "real" PSU is risky, because they tend to produce >5V as they die, taking the C64 with them. That's why I ended up using the Ultimate 64 rather than a real C64: just supply it with 12V DC from basically anything, and it will be fine.
The PSU situation isn't great: building your own is difficult (see https://www.c64-wiki.com/wiki/Power_Supply), and using an old "real" PSU is risky, because they tend to produce >5V as they die, taking the C64 with them. That's why I ended up using the Ultimate 64 rather than a real C64: just supply it with 12V DC from basically anything, and it will be fine.