you are correct. it technically is possible to gain muscle at the same time you're cutting, but it is very difficult and slow.
Please keep in mind that losing weight is based mostly out of diet, or what i would probably say 75-80%. cardio makes the process slightly faster (HIIT probably more effective). So even if you do all that neat stuff, a bad diet can make it look all for nothing, and may even just make the situation even worse. Eat healthy, but don't starve. Eat a good amount, and take away a decent amount of calories each day or so. When losing weight, there always has to be some sort of shortening intakes.
Again, building muscle won't be as effective when cutting. food is vital for gains.
Later if you're looking for building muscle or strength, i recommend a program. You can look for one online like ICF 5x5, etc. Currently I'm doing Babylovers SS, a variant of SS. It consists of mainly compound movements. keep i mind that if ur looking for gains, compound exercises are most effective, and should be the base of your workouts. sets and reps are 3x5. the exercises are: barbell squats, bench press, deadlifts, barbell rows, military press, chin ups, dips, and a range of optional isolation movements. Every program has something called a progressive overload. you add weight each session. every exercise is increased by 5 pounds except for deadlifts, which is 10 (might change later on in heavy weights)
This program helped me progress a lot, and im sure others will help as well. In just 2 months, I raised my squats and from nub 95 lbs to 230 lbs, and other exercises has progressed a lot as well. I gained massive strength in short time, and thats the benefits of programs. It takes less time each session, but it consists of heavy lifts.
I recommend a program. If you want adequate muscle, a program from someone who is experienced will help you a lot