The first stamp means that your exit from the Schengen area was cancelled. This is a good thing, since if you had been allowed to exit the Schengen area, you would not have been able to fly from the UK to Italy.
The second stamp means that you were refused entry into the UK. You will have to report this if you’re ever asked whether you were refused entry. If you explain the circumstances, the refusal is not likely to have much of a negative impact. The key points are:
Credit:stackoverflow.com‘