I was having this exact problem! I got my iPad two days ago and I’ve playing around with it and everything has been working fine. But then today suddenly the pencil wasn’t working even though it was charged 100%. I restarted the iPad multiple times and still nothing. Finally, I realized the nib had been slightly unscrewed. Once I tightened it, everything worked fine lol. I’m not sure how it became unscrewed between me putting the iPad down last night, going to bed, and then trying to use it again this morning, but it seems like that’s all that was wrong!