せっかく and のに are used together when great effort has been put into something, yet that effort may be going to waste.
The situation reflecting the effort appears between せっかく and のに.
- Kamiya, Takeo. “Adverbs Expressing Circumstances.” The Handbook of Japanese Adjectives and Adverbs, Kodansha, 2002, p. 191
- How to use せっかく ( = sekkaku) (maggiesensei.com)