Does it raise questions that I left Company 2 after only 3 months, and that I went back to Company 1?
It does and you will be questioned on this.
The fact is, if you have a reasonable, logical, verifiable reason for returning then it won't be an issue.
If the company 2 role was a contract position I would highlight that on the CV.