MacBook Pro 2017 without Touchbar Not Charging
However, if the laptop is asleep the system stops charging. It only seems to charge asleep when the charger is directly connected to the computer. 


You've narrowed down the problem to the "splitter."

If it charges when directly connected, but not when going through the splitter, your MacBook is not the cause of the problem.  If you were to bring it into any Apple store or repair shop, the first thing they would do is hook up a known good working charger to your MBP.  If it charges while sleeping, you'd be told that your MBP is working correctly; which it is.

What to do?

That vintage MacBook Pro has two Thunderbolt 3 ports so...


Return the "splitter."   
Try not to use HDMI (it's very flaky, IMO).  Use DisplayPort instead. Thunderbolt 3 natively outputs DP; it will have to convert the signals to give you HDMI. 
Use a "proper" (meaning an active adapter) USB-C Hub with Power Delivery and 4K support if you must use HDMI.   
Because you only have 2 TB ports, I would spring for a Thunderbolt 3 dock instead.  This way you'll have ample room for growth should you want a second monitor or additional USB ports.


(Standard disclaimer follows)

Of course, if you're not comfortable that your MacBook Pro doesn't charge with the splitter you've chosen, by all means, return the Mac.  If your splitter continues to exhibit the same behavior, you'll have proof positive that the splitter is the issue.