Employment contract help

I have recently resigned from my Company A and they have requested that I pay out my RM8k bond. However, they are not actually my legal employer as they used an agent to assist with the process. As per my passport, I am actually employed by another company, Company B. Company A and B have a legal agreement whereby I provide my services as a consultant and in return company A pays a monthly consultancy fee. The RM8k bond clause was only included in the contract issued by company A. Other details include (1) Company A gave me a promotion managed 2 departments but was given a pay cut in January and wasn't issued a new Employment Contract (2) They failed to fulfil the clause regarding medical insurance. Therefore I was wondering, given that my legal employer is company B and reasons 1 2, is the contract I signed with Company A even legally enforceable ?

Appreciate all the help!

Consult a lawyer.

The tricky part is whether your EP was ever actually legal or whether it was a "fix" because the company did not have the right incorporation structure to hire foreign staff.

I see you are looking for leverage but be careful as blacklisting is a possibility.

Company A did not have the right incorporation structure to hire foreign staff and that's why they chose to use an agent for my EP. Do you mean blacklisting of the company or I will get blacklisted?