CNN can't predict images outside the dataset
That could a lot of reasons for that. For example, images are sometimes represented with numbers in range 0-1 and sometimes in range 0-255 and it's very easy to mix these ranges for in-dataset / external as the model would fail silently without any warnings.
In general, if the same model gives you different results, then images are not exactly the same.
I suggest you take the same image from your dataset and internet and compare the raw numbers on the input of the model. If results different, then input tensors should be different and you can check your preprocessing pipeline step by step to find the point of discrepancy.
The debugging tools like ipdb are usually very useful in such situations.