If the agency you did the locum shifts for isn't liable to pay you smp and you employed by them in the 15th week before the baby was born then you can still work for them during your maternity leave. Workingfamilies.org.uk is a,good source of info.
When you work as a locum are you self-employed or employed by the agency? If you are employed and the following applies you can: you are being paid a second lot of SMP as an employee from the agency and you do it as KIT days.
If you are working as self-employed when you are doing locum work then can, so as long as there is nothing in your employment contract restricting you working for someone else or working during maternity leave. However even if that looks ok it is worth checking the terms of your OMP in case there is anything extra in there. SMP is unaffected so long as you are working in a truly self-employed capacity.
It may be that you should have claimed a second lot of SMP from the agency so long as you meet the required criteria.