Fixed: on selection the text is copied, so it is impossible to replace the text with what is in clipboard as the content of clipboard is already replaced by old text.
https://emacs.stackexchange.com/questions/74298/setq-select-enable-primary-t-breaks-copy-paste-in-emacs-28