Why does this RSA example break when: 1) setting p or q as non-prime, or 2) setting p and q as the same number?
A first step is to use the correct value for
the totient function
$\phi(n),$ which is $432$ and $110$ in your examples. 

Even better use the 
Carmichael function $\lambda(n)$ as described in RSA key generation, which is
$36$ and $110.$ 

With either of these numbers, your encrypted messages are decrypted correctly.