Impact of the flexocaloric effect on polarization in the flexoelectric layer