I came across Euler's proof that $\displaystyle\sum_{n=1}^\infty \frac{1}{n^2}=\frac{\pi^2}{6}$. One of the ingredients of the proof uses $$\prod_{n=1}^\infty \left(1-\frac{x^2}{n^2\pi^2}\right)=1-\frac{x^2}{\pi^2}\sum_{n=1}^\infty \frac{1}{n^2}+\text{higher order powers}$$ i.e. it seems that we can treat an infinite product as a finite product in the sense that we can "multiply it out and collect like powers". How can this be justified? If it cannot be justified, can you give a counterexample?
Assume that the infinite product converges absolutely.
The fact that many infinite products in Euler have some properties of finite products is explained in this publication in Journal for General Philosophy of Science. Briefly, Euler's procedures can be formalized in a hyperreal extension of $\mathbb R$ where unlimited integers (greater than every standard integer) are available. Infinite products are often approximated infinitely well by hyperfinite products. The latter have all the first-order properties of ordinary finite products. The article linked above analyzes in detail Euler's proof of the infinite product decomposition for the sine function.