Since you are talking about returning it is probably not the case, but i will write it for other users in the future:
If it is older laptop and does not have some kind of preservation mode (to charge to about 80% on AC), and always charges and holds 100% on AC, the typical life of a Li-Ion/Pol battery is between 2 !! (yes until the end of warranty ) and 4-5 years and it dies. But dying usually means holding charge for about 5-10 minutes. Completely not detecting is more like broken controller or short circuit. Both cases for warranty claim.
There would likely be no battery level indication below 100% if your machine is always plugged in - I wonder if journalctl -b | grep battery was simply reporting that the battery was not being used.
The software that interacts with it can be at times. A wild guess on my part though, as the only laptop I use is on power 99.99999% of the time – battery lasts 5-15 minutes unplugged, last time I checked – I’m never too concerned about its status.