All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
It appears from your question that you have some kind of whispers, so seek refuge of Allah from them, avoid them, and do not pay any attention to them, for being carried away with them is a great evil.
With regard to what you mentioned regarding the addition of “bar” in order to pronounce the letter "ر" in a correct manner, it is one of the effects of whispers that you must avoid and ignore.
Your prayer is not invalidated by that and you did not fall into a major sin.
Allah knows best.