Stored procedure not working
Just what it means. Some commands cannot be invoked from within stored routines. Creation of a stored routine is one of them. As another example, you cannot LOAD DATA INFILE from a stored routine.

You may try and do it with a prepared-statement, only to find that CREATE PROCEDURE cannot be invoked via prepared statement.

Sorry - no way around this that I know, and I've done my share of search on this.