Can coherent Smith–Purcell radiation be used to determine the shape of an electron bunch?