As with this example many place=city/town entities are nodes. If you're unable to rely on admin_level, you'll need to iterate the returned boundary relations to return nodes with 'admin_centre' roles. These should contain 'place=city/town'.'place=city/town'.
Try expanding on this:
node(3127879237);
is_in;
rel(pivot)[boundary=administrative];
node(r:admin_centre);
out geom;
As with this example many place=city/town entities are nodes. If you're unable to rely on admin_level, you'll need to iterate the returned boundary relations to return nodes with 'admin_centre' roles. These should contain 'place=city/town'.