This sounds like you have a running process which is stopping the system from going into sleep mode. Replacing the battery won’t directly affect going into sleep mode but that’s not to say there can’t be a power system issue either.
So let’s first deal with the power aspects, install this gem of an App [https://www.coconut-flavour.com/coconutbattery/|CoconutBattery] here we need to grab a few snapshots of the Apps main window. So with the battery fully charged take a snapshot with the charger disconnected, give it a few minutes to settle down first. Now put the system into sleep mode with nothing connected, give it at least six hours undisturbed. Bring the system back alive and now take another snapshot. Post both snaps here so we can see things.
Fixing a running process (or one that’s stuck) will require doing a hard shutdown, but before we do that let’s open up Activity Monitor and look at the running processes. Click on CPU and then click on %CPU column so the highest use is at the top. Take a snapshot down to the first 0.0 entries as you’ll want to compare this after you restart your system. I’ll be honest here this is a bit hit or miss.