I'm having this same issue. I get the same $$magic$$ error as well. I tried passing a .stl hint to assimp importer, but that didn't work either.
I have a lot of stl files included using qresources, so it would be a pain to migrate away, but it is feasible. I was using Qt3D before, but am trying to get away from it since it's being deprecated. Hoping someone here has some hints.
const auto qrc = QResource{filePath.string().c_str()};
auto qfile = QFile{qrc.fileName()};
qfile.open(QIODeviceBase::OpenModeFlag::ReadOnly);
auto data = std::vector<char>{};
data.resize(qfile.size());
qfile.read(data.data(), data.size());
const auto ret = importer.ReadFileFromMemory(
reinterpret_cast<const void*>(data.data()), static_cast<std::size_t>(data.size()),
aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_FlipUVs);
qWarning() << importer.GetErrorString();
return ret;