Do you have this problem with your 2018 iPad Pro? Often, when I turned on my iPad, I found the pencil is connected, but not charged. Sometimes, the battery can be empty. It's magnetically connected to the side of the iPad, but it's not being charged. I am using a Logitech Symmetry case. There's nothing between the pencil and the side of the iPad. Thank you.
When you attached the pencil to the iPad was the iPad active? I believe that in some cases you must have the device active when attaching something in order to have the attached device do anything including charging. Hopefully this makes sense.
It sometimes happens. Just pick the pencil up and re-attach it to the side will kick start the charging again.