it seems in top stories and top results AMP urls are identified by the presence of the AMP symbol.
for example:
only the first carousel in Top Stories have the AMP symbol. The other 2 carousels in Top Stories don't have the amp symbol because there is no images.
The logic shouldn't just search for the "AMP logo" but also search for the AMP class "amp_r" to identify AMP articles