Are computers weaker at endgames?

Im studying Silmans book, Complete Endgame Course, and this position is given in one of the test problems, asking the player to evaluate g5. In the solution, it gives ... g5?? as losing.

To see how it would play out fully, I entered this position into CM 10 and let it play against itself. I know its not the best, but its still rated at 2900+. Guess what move it made -- g5. It also ended up drawing w/ black when I let it play out, and winning, as black, when I forced it to make some moves early.

My machine never considered 1. .... g5 in the top three, all the way from depth 1  to depth 26:

Here's the evaluation after 1. .... g5 (depth 24):

In general, and without talking specifically about the position you've provided, yes, computers are weaker at endgames than other aspects of the game, with some caveats.

In a simplified position where the engine can make use of tablebases (I'm not sure if CM uses these, so I'm talking about computers in general), it can play the endgame position perfectly just by doing data retrieval. When the game isn't yet in that state, the computer has to look ahead to a certain number of ply and evaluate the resulting positions as good or bad. If it finds positions in the tablebases known to be a win/loss/draw, evaluating the position is easy. When it's not found, things can be a little dicey with respect to endgames.

Endgames are obviously different from middlegames, and the computer must evaluate them a bit differently to be effective at endgames. Endgames usually require king activity (something that would be suicidal in the middlegame), and focus on the creation and promotion of passed pawns. Realize that humans can learn lots of endgames tricks: opposition, triangulation, square of the pawn, etc. to guide them when looking ahead, but computers (for the most part) have to continuously rediscover this knowledge by brute force search. If the key outcome of that technique is just beyond their search horizon, they can miss making the key move in a critical position, but then have no chance to recover because endgames can be unforgiving like that. This is more likely to happen in endgames than other phases of the game because it is possible for a human to look ahead much further than in a normal middlegame position when you know the kinds of things you should be looking for.

This is further complicated by the question of when does the transition from middlegame to endgame occur. In a complicated queenless middlegame, the human might transition to thinking about the endgame, but the computer could still be registering it as a middlegame position and evaluating it as such.

Now, anything that can search ahead enough ply is going to still play beastly chess, but you're more likely to see a machine occasionally get tripped up in a complicated endgame than in any other phase because of some of the reasons I've outlined.