Why are the queryid different?

It is a different story then, if you terminate the query it may get different query_id, but you will see additional values in pg_stat_monitor, in columns: elevel, sqlcode and message, that the query was not finished properly. See below:

You can query all queries that are using the same relations, are of the same type (SELECT, UPDATE, etc.) and maybe have some part of query is also the same, using like ‘%o.amount >50%’, or even use full query if you need to check if those are exact matches. Query_ids are different, because one is for query that finished properly, and other that were interrupted for some reason. Their execution was different, so they have different query_id.