The problem was in the setData function of my PandasModel. I was using values instead of iloc.
self.data_frame.iloc[index.row(), index.column()] = value