I would discuss with HR (if you have someone) to get more information about what exactly is going on. It is sometimes the case that the manager might not have informed HR of all the information (also make it clear that you are pregnant), and that you want to apply. It is also often the case that the role will be advertised internally and externally.
Unfortunately, an employer is under no legal obligation to offer a post-holder on a fixed-term contract the same job if it is made permanent. However, they must give them access to apply for permanent vacancies. They must also explain why the fixed-term contract is coming to an end and a right to appeal should be given. It can be a valid reason that the role is made permanent, but you weren’t successful at interview. If the reason for the ended FTC has any relation to pregnancy or maternity then this is against the law.
Due to the fact that you are pregnant if the role comes to an end and you are made redundant then you must be offered any suitable alternative vacancy which exists.