A very important attitude a scientist should have when their findings or results go against previous ideas or predictions is honesty. As a scientist, you need to be open-minded and accept the results of your researches whether they agree or go against previous ideas.
The idea of honesty is to ensure that scientists don't tamper with their results because of their beliefs, emotions, and other things. While this actually sounds good, you must balance it with skepticism, the attitude of questioning, and doubt. What this means is that as much as you are expected to be honest in your findings, you shouldn't relent until you get similar results as other scientists.
As a scientist, you need to always adopt this skeptical approach as you might have made some mistakes in the experimental process. However, in the absence of any mistake, this approach can put you on your way to forming new scientific ideas.