Sometimes I get asked if you can play notes that are outside of the scale. I’d like to remind you that there are literally no two notes that cannot go together. Remember also that any two notes can be paired in one of two ways.
This is a minor second, but if we move this C up here, it’s a major seventh. Same two notes. Similar sound, but twice as many possibilities.
For example, this minor second could be a beautiful major seventh chord centered around the key of D flat. Alternatively, centered around the key of C, it could provide the bed for an exotic Arabic scale. A perfect fifth becomes a perfect fourth.
Your perfect cadence becomes a plagal cadence. Remember, there are at least two really good reasons any two notes go together. Try them out.
Trust your ear because when you strike gold, music theory is just a way to give that golden name.