Are you sure you tested it all core at 5 ghz, because the 9900K is not able to reach 5 ghz all core out of the box and you shouldn't do that. It has a 4 core boost of 4.8 ghz, and an all core boost of 4.6. This is true for basically all processors, the single core boost will be higher than the...
Download Ryzen master and manually set the clock speed also check that your cpu power cables are plugged in all the way on the motherboard, a power cable failure would cause the cpu to clock down because it's not receiving enough power