tells LaTeX which input encoding to expect. This is the encoding that your document is saved in.
You cannot save your document in two different encodings. (You could make two copies - one per encoding - but a single file has a single encoding.)
So you cannot use both
for the same document as you are effectively telling LaTeX, 'Hey, I'm a file encoded in both latin1 and utf8!' and that obviously cannot be true. Encodings apply to files and not parts of files.
If you really need the flow chart in a different encoding (but why?), then you would need to compile it as a distinct document and include it as a graphic, for example, or as a PDF if it is a stand-alone page.
Note that your package calls are dealing with two distinct kinds of encoding: input encodings (
inputenc) and output/font encodings (
specifies the output font encodings to be used. Unlike input encodings, you can switch between these encodings within a document. (In fact, LaTeX will essentially do this whatever you do when it sets up the fonts for mathematics.)