I don't think there were electric guitars until the 1950s.
Not that they couldn't be invented earlier.
And if there was a time metal could be invented earlier, the 1920s seems about right. You just had a gruesome and bloody world war, fascism taking root in post-war Europe, HP Lovecraft is still writing, you have movies like Metropolis around to influence metal imagery...
Another problem is, alot of what we think of as heavy metal is taken from punk. Metallica, etc. took alot from bands like GBH, Discharge, the Misfits, Black Flag.
You'll basically need earlier electric guitars, and an earlier rebellious youth culture, which, the 1920s being the time of bomb throwing anarchists, flappers, the Red Scare, the communist revolutions and fascist coups in Europe, is probably a great time to have it.
Since a lot of OTL metal is very dated as it is, you should probably think of the some fictional metal bands.