Flat band potential determination: avoiding the pitfalls