The confidence interval calculations assume you have a genuine random sample of the relevant population. If your sample is not truly random, you cannot rely on the intervals. Non-random samples usually result from some flaw or limitation in the sampling procedure. An example of such a flaw is to only call people during the day and miss almost everyone who works. For most purposes, the non-working population cannot be assumed to accurately represent the entire (working and non-working) population. An example of a limitation is using an opt-in online poll, such as one promoted on a website. There is no way to be sure an opt-in poll truly represents the population of interest.