There are ways to migrate your Server 2012 SQL failover cluster to 2016 or 2019.
The first one is to migrate it to a new cluster by creating a parallel SQL Server environment on a different Windows Cluster with Windows Server 2016 or 2019. That means, you will need to create 2 new 2016 or 2019 VMs and create a new cluster. The impact is that there will be some downtime.
Please refer to below articles for details.
The second one is to do in-place migration to Server 2012 R2 first and then do rolling upgrade to 2016 or 2019.
Please read below articles for detailed steps.
In-Place Migration for a Two-Node Cluster: Migration to Windows Server 2012 R2
Cluster operating system rolling upgrade
If the Answer is helpful, please click "Accept Answer" and upvote it. Thanks.
May I know if your issue is resolved or not?
It will be much appreciated and encouraged if you could click "Accept Answer" and upvote the helpful reply.
Thanks a lot.