It seems your document is in indexed color mode. This might be counter-intuitive, but this is how indexed mode color selection is supposed to work. Instead of assigning RGB values to each pixel individually, it assigns them an index number, that corresponds to a color in your pallette. That’s why if you were to re-arrange your pallette, the colors on the canvas would change, because a pixel that was pointing at index 10 before, could now be pointing at a completely different color that happens to be index 10 after you rearrange colors.
When you select a color with those color sliders down there, it tries to best match the RGB colors you select to an existing index from your pallette and lets you draw with it. In order to select colors like that, you’d need to unlock your pallette with that lock button in the top left corner of your pallette. Now it will allow you to edit the RGB values of the indexes themselves, so you select a color from your pallette and edit it. That will affect pixels that are already using that color though, so if you need a new color, create a new index, or use a color that you haven’t used in your pallette.
An alternative, if you don’t need indexed mode, is to switch to RGB mode from Sprite>Color Mode>RGB Color. This would make the program behave more like photoshop, where you can save colors in your pallette, but paint with colors that are not in your pallette too.