Are you on NothingOS 3? I have seen other people complaining about the same.
Currently there’s some walkaround you can try. Connect the charger when the screen is on (Home screen). Another thing you can try is, connect the charger and if you notice that it’s charging slow, disconnect it and connect it again.