I'm also getting similar situation on regular basis since that game was introduced.
Glitch in Puzzle Battle

It's based on your wins/looses I guess. But the good new for that longstanding bug is that it can sometimes benefits you. Couple of times when I won my rating dropped, and couple of times it raised despite my lost.

Another interesting puzzle battle behavior : sometimes it repeats exactly the same sequence of problems more than one time in a raw. The same never happened to me in puzzle rush. Probably it's another bug in algorithm because the person who gets this "benefit" has clear advantage against his new opponent.

Here is another bad luck for me. My score was worse all the time, but in a last sec I was able to make it even, and though number of my mistakes were less, and produced message indicated my win, part of algorithm which calculates rating probably were not synchronized with the one calculating win/loss result.So, it looks like catching up in last sec is the reason for such bug.

I assume that is based on the analogy with regular games, but of course you may contact chess.com support team to clarify this.

Both players get the same set of puzzles. Yes, the rating is based on whether you win or lose.
https://www.chess.com/news/view/new-feature-puzzle-battle
From the above link "(Note that this rating has nothing to do with the puzzles themselves or how difficult they are; it's all about how you fare vs your opponents in Battle, just like rated chess games.)"

To everyone saying that it's by the puzzle difficulty and not the win/loss: Think about this, how is it even a battle when it doesn't matter if you win or loose? It would be pretty much the same as puzzle rush.
Um... So, I won, but my rating went down. If you zoom in, or open it in a new tab, you can see that it went down 55 points.