Prevent phone auto-connect to a specific wifi connection, without forgetting that connection
From what I can see, there really is no way to do it directly

There are root workaround but nothing that only allows manual connection (excluding Samsung or MIUI stuff); it must be OEM implemented. I can't find any way to do it in standard AOSP or lineage OS

You could always try something like Tasker and have it shut off WiFi when your in range of a network you don't want to automatically connect to