@Maksym **********
When you want to use the visa together with your new passport without old passport the only solution is exactly what embassy said, you have to apply for a new visa.
Embassy is also the only one who can cancel the old visa.
Some countries let embassies transfer their visa to another pasport, but most, including Thailand don't do this.
Embassy just should now the visa is still valid in combination with the old passport, it is their responsibility to decide about validity of a visa, not immigration.
Immigration does not decide about validity of a visa, they can only check if it is valid, and a visa is only valid in combination with a passport, no matter if the passport is still valid as travel document or not.
When you show a vslid visa in combination with the connected passport immigration has to accept that as a valid visa. When you show that same visa with a different passport Immigration might accept it as valid when they see a transferred stamp mentioning the old passport number and visa number in the new passport, or see a remark in the passport that it replaces the old passport, but they can insist on showing the old passport, whicj means it can be different depending on IO.
Conclusion, questions about validity of visa, transferring visa or cancelling visa should be adressed at embassy, not at immigration,