Fair point but cabin crew are not doctors, we cannot make a diagnosis and in that case would make any and all attempts to provide first response.
Of course, in a cardiac arrest situation the chances of being of any help whatsoever are slim- but we cannot tell that standing behind a cockpit seat looking at the back of his head.
Much easier to assess the situation with the pilot in the galley or other suitable area, not to mention not being a distraction to the remaining pilot (and also a lack of room to do so in any flight deck other than possibly the 380- it's still be a tight squeeze)