Sorry for previous anonymous replies.
The problem is in the YAML, because the content of variables can be printed on the screen, or dumped by other tools like Dump or write directly to the file without any problems. But the content of variables passed from one script to another not working with YAML, which is a very strange, like these variables start to have some kind of bad flag or mark.