A flapper hanging down over the opening, that opens during normal flow, will accumulate debris that keeps the flap from closing during a backup. It is intended to be normally closed until there is flow.
This illustrates normally open"
This is the plastic one common in Canada.
With no flow or normal flow, the gate lays down. If the water level rises because the sewer does not empty, the float raises the gate. One disadvantage of that is that you need a little extra drop between input and output. That is easier for new use, but for retrofit, you would need to dig up a longer area to flatten the slope before and after to let you have the little step down.
https://www.floodexperts.com/ is the company I was thinking of I think.
Their system with the pit in the yard will accumulate sewage from the house, and a float-controlled grinder pump will drive the sewage downstream of the valve. I was surprised that cities allowed that, but they do. They don't like basements flooding either. Overhead sewers are the best prevention of basement flooding, but this pit system retrofit costs maybe half the cost of overhead sewer retrofit.
NC is going to be more reliable with time I think.