Caused by fe0e2907b3
Prior to that commit, adding palette colors was only working because
`BKE_paintmode_get_active_from_context` was falling through to
`PaintMode::Texture2D` which then would do its thing in
`palette_color_add_exec`
To resolve, now respect `PaintMode::GPencil` as well there.
Pull Request: https://projects.blender.org/blender/blender/pulls/125062