Inversion of a SIR-based model: A critical analysis about the application to COVID-19 epidemic