Catalyzes the cleavage of thioester bonds from S-palmitoyl- CoA or S-palmitoyl-N-acetylcysteamine (unbranched structures) but does not have activity against palmitoylcysteine or palmitoylated proteins, branched structures or bulky head groups. Conversely, hydrolyzes both long and short chain fatty acyl-CoA substrate. {ECO:0000269|PubMed:10417332, ECO:0000269|PubMed:12855696, ECO:0000269|PubMed:9341199}. [Isoform 2]: Catalytically inactive due to lack of active site His-283. . This is the function of Ensembl gene identifier ENSG00000221988 (PPT2, palmitoyl-protein thioesterase 2).