The book was about a girl or perhaps princess who could not either touch people or be touched. Then later she meets a boy and they fall in love then accidentally end up touching but nothing ends up happening. It was set sometime in the past I believe royal-esque times. It is not Shatter Me.
Among this fairly common trope, a partial match is The Sin Eater's Daughter (2015) by Melinda Salisbury.
Sixteen-year-old Twylla lives in the castle. But although she's engaged to the prince, no one speaks to her. No one even looks at her. Because Twylla isn't a member of the court. She's the executioner. As the goddess-embodied, Twylla kills with a single touch. So each week, she's taken to the prison and forced to lay her hands on those accused of treason. No one will ever love her. Who could care for a girl with murder in her veins? Even the prince, whose royal blood supposedly makes him immune to her touch, avoids her.
But then a new guard arrives, a boy whose playful smile belies his deadly swordsmanship. And unlike the others, he's able to look past Twylla's executioner robes and see the girl, not the goddess. Yet a treasonous romance is the least of Twylla's problems. The queen has a plan to destroy her enemies-a plan that requires an unthinkable sacrifice. Will Twylla do what it takes to protect her kingdom? Or will she abandon her duty in favor of a doomed love?
- Medieval times
- The girl is not a princess, but is betrothed to the prince
- She falls in love with a boy she doesn't harm, as per this review:
Lief kisses Twylla to prove that she can touch people without killing them. Seems a bit drastic. He then asks her to marry him and suggests they run away together.
Not a match:
- The girl discovering her touch doesn't affect the guard does not seem to be an incident.
Found with the Google query
fantasy book girl can't touch people site:goodreads.com, deep down the sixth page of results.