I recently underwent a huge surgery due to a intestinal-disease. Had my entire larger intestine removed, lived with an ostomy for 7 months, needless to say, I haven't been able to lift any weights throughout all this. I finally had my ostomy reversed, and I'm anxiesly awaiting to get back into shape and pack on some much needed muscle.

Unfortunately, due to the surgery, I am not able to sleep throughout the night. I wake up twice every single night, having to go to the bathroom. This results in me, lying awake for about 15 minutes before falling asleep again.

My question is, will this influence on any possible gains? I haven't been able to find an answer anywhere.

To improve physically, you need to get adequate rest, and that includes getting into REM and Delta wave sleep. Ideally this happens in one solid 7-10 hour chunk, so it may be something that effects what you could be gaining, but doubtful it would be to a degree beyond where you are affected already with what has happened.

In other words, the waking is nothing to lose sleep over (sorry I couldn't resist) you already have a new normal with the speed at which you recover and supercompensate, which is going to effect you much more greatly than waking a time or two a night.

Just conjecture and there is no way of knowing without a sleep study, but you're probably waking up after you finish a sleep cycle, as we have "deep" and "shallow" phases of sleep throughout the night, and it takes much more signalling from our internal or external environment to rouse us from a "deep" sleep phase. If this is the case it is less impactful than waking when you are in that "deep" sleep.