Presumably, the multi-attack with different weapons means that the creature is actually holding those weapons and is using them to fight. Thus, if circumstances conspire to have the creature hold different weapons, then by all means, vary their weapon attacks. (Although, do be careful with the CR, as mentioned by @Anagkai)
Making two attacks with the spear and zero with the longsword, however, seems to go against the spirit of the creature's mechanics. There is such a thing as a fighting style, and that's what comes described in the multiattack entry. The "sentience" of the creature has little bearing on the issue.
Your example of the goliath warrior is pertinent. It makes two attacks with whichever weapon it happens to be favoring (or even holding) on that turn. As such, mixing weapons in the same turn seems to go against the description of how the creature fights. (Also, being able to engage the fighter with the melee weapon at the same time as the caster with the ranged weapon gives the creature a significant tactical advantage.)
The part about substituting one specific attack with other types of "attacks" is even more troublesome. Some of those "attacks" are actually actions, and if the creature even has the ability, they would come at the cost of all the attacks in the multiattack, not just one. Some others are substitutes for a single weapon attack, and in that case, I guess it could work, but you still have to consider whether the creature would even have the appropriate skill to attempt it, which is something that would appear in the stat block, I think.
For all of the above, I would caution against making these kinds of changes.
That said, as DM, when I want to introduce some spiciness in a combat and maybe catch the players off-guard, I have been known to introduce these surprises here and there, with the caveat that I allow them for only one specific individual, and I always point out a specific different description for that individual. If the change is harsh enough (like a significantly different damage or tactical potential), I also up the CR a bit for that individual.