Gibson Les Paul Custom Twentieth Anniversary Model 1974
Is this a genuine Gibson or a replica

In 1977 I bought a Gibson Les Paul Custom Twentieth Anniversary Model 1974. The serial number stamped on the headstock says 4000000. Why does the serial not begin with a CS like normal Customs? What's your thoughts?

Well, the Custom shop division already exists since 1960, but not as a separate Custom Shop division/ factory as is nowadays the case.
We did however not use a custom shop designation as CS or a custom shop stamp back in those days. The custom shop was more for custom orders. The 20th anniversary Lp model would be a normal "standard" production model.

that is a strange s/n. My 76 custom ordered LP custom starts with 00 and then has numbers. The first two numbers signified the year of production back then.

The serial number system you mention was ONLY used in 1975 (99), 1976 (00), and 1977 (06). Just prior to this era a random 6-digit number was used, and after this time the current 8-digit system was put into affect.

PS: The OP does have an extra zero in his SN post, I'm sure he meant 400,000 which would be from 1974.