The stock CPU Cooler that comes bundled with your 5600X is the weakest of all of the Wraith CPU Cooler the "Stealth"
It should be adequate enough to prevent your processor from overheating under normal use but it will run hotter under heavy loads like running a game.
Plus if you have poor air circulation inside your PC that would cause your processor to overheat.
I would purchase a 3rd party CPU Cooler of at least 125 Watts TDP rating to keep your processor from overheating and keep the Wraith Stealth as a backup CPU Cooler.
Take a look at this PC Building tech site PCPARTPICKER. I have linked the page that shows all the compatible CPU Coolers for your 5600X: https://pcpartpicker.com/products/cpu-cooler/?compatible_with=g94BD3
Pick the ones that within your budget and make sure it has at least a TDP rating of 125 watts.
Otherwise I suggest you look at YouTube videos showing how to correctly install the AMD Wraith Stealth CPU Cooler.
Yes if it isn't properly tighten down on the processor and not making a solid connection to the surface of the CPU then it would run hot and overheat.
But be careful not to put to much torque when screwing down on the Motherboard's brackets. You can strip the screw hole.
Just screw down each screw in a "X" pattern untill they stop turning.