You do not say whether the journal has a policy on how soon revisions must be returned. Some "top" journals only allow a return within a specific window of time. Otherwise, the dust gathers, new information appears that supersedes the publication, and what was once acceptable is no longer acceptable. Otherwise, some "top" journals consider anything submitted after the deadline to be a new submission worthy of an entirely new round of first (not second) reviews.
You should confirm that you submitted your revisions within the allotted deadline.
Considering the case where you did submit the revisions promptly enough, a period of 6 months or 12 months to hear back is rather long. Have you maintained a record of email correspondence asking the editor for a status report over those periods? In such a case, the onus can fall on the editor to explain the change in opinion. Otherwise, the long delay may be a case where the work simply and inadvertently fell through the cracks, as the saying goes, both from your side and from the editor's side.
In the meantime, you may also want/need to justify that your paper is still "top" quality in terms of meeting the guidelines for the journal. Have findings from your work already been published in the meantime, so that what you once submitted those 18 months ago as fore-front work is no longer fore-front work? Have the findings from your work long since faded out of the appeal for the journal, so that what once was occupying a significant chunk of reports in your field is now occupying perhaps only a sporadic hiccup in some on-line journal in a foreign language? You can only do well to present supporting information to show that your work is still worthy of publication in the "top" journal even after the 18 months time. You may even have the foresight to provide a revision to the citations with any updated information to support your case (e.g. a recent publication that shows the continued relevance of your work even after this time). If you are inclined to put in the additional effort and if the option seems to arise, you may even consider asking the editor whether, in light of the circumstances, you might have permission to resubmit with revisions that will highlight the article's relevance even after the 18 months. Given the previous history of long delays, I suggest that you may want/need to negotiate a definitive frame with the editor to get this done in short order if at all.
You can also do well to determine whether your report represents an anomaly or not. What are the typical turn-around times from submission to publication in the journal? You can generally find this by looking at the submission and acceptance dates. Is a period of 12 months representative? Are there clear cases where the turn-around was even longer? Also, this report is being considered in a time-frame under COVID-19 contingencies. Does the journal provide any notice of grace periods for such contingencies?
In summary, you are within bounds to ask the editor why your paper was accepted with minor revisions (after 12 months) and then, 6 months later after those revisions were submitted on time, is flatly rejected. You are within bounds to go one step further above the editor as supported by any records of follow-up contacts with the editor over that extended period.
Unfortunately, even with all this, your paper may remain rejected, you may not be able to find out entirely to your satisfaction why, and you may have a suspicion that something was "dishonest" about the process. Reflect that your perceptions may not be the full reality. Perhaps, all things considered, this is a case where the work simply got lost in the administrative shuffle for the two periods of time and that, after 18 months, the same reviewer had an objective change of mind.